Reply
Super Contributor
rov
Posts: 575
0
Accepted Solution

Alphabetizing the order of Dynamically created documents

On our web portal, we dynamically create a list of documents for an Account . These documents are associated with different programs.Is thre a way to alphabetize the list of documents?

 

Can these docuemnts be listed as -

 

Abc

Bsx

Cqa

 

Instead of being listed in the order in which they were fetched.

 

Thanks.

Moderator
Ankit_Arora
Posts: 1,767
0

Re: Alphabetizing the order of Dynamically created documents

Have you tried using Order By ?

 

List<Document> doc = [select id,name from document order by name ASC] ;
System.debug('Doc ::: ' + doc) ;

 Let me know if it resolves your problem.

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

Force.com MVP
Certified Developer | Twitter


Don't forget to give KUDOS if post helped you.


Latest Blog Posts : Streaming API- Easy Code AND Uploading Multiple Attachments into Salesforce - Simple Code


If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.