Advertisement
martyychang

Example: Retrieve image documents stored within a named fold

Feb 15th, 2014
634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. public class Example {
  2.  
  3.     /*
  4.      * Define the name of the folder containing your images as a constant
  5.      */
  6.     public static final String IMAGE_FOLDER = 'Downloadable Images';
  7.  
  8.     /*
  9.      * Example for retrieving all PNG files within the images folder
  10.      *
  11.      * @return A list of retrived documents
  12.      */
  13.     public static List<Document> retrieveImages() {
  14.         return [
  15.             SELECT Id, Name, Type
  16.             FROM Document
  17.             WHERE Folder.Name = :IMAGE_FOLDER
  18.             AND Type = 'png'
  19.         ];
  20.     }      
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement