function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
crmexpertcrmexpert 

sort the fields in vf controller

i am working on a vf controller..i need to sort the fields..not the values upon a particlular field..that is..i need the output as:

 

age,  billing city, .....firstname, gender, lastname ....

 

that is alphabetically sort the FIELDS!!..

 

does anybody have any idea...????

Best Answer chosen by Admin (Salesforce Developers) 
MeghaRaheja1MeghaRaheja1
did the same by bubble sort

All Answers

MeghaRaheja1MeghaRaheja1
did the same by bubble sort
This was selected as the best answer
crmexpertcrmexpert
Thanks..
TehNrdTehNrd

If you need to sort I would recommend checking out this post. It provides a sorting methed that is much more efficient, and easier, than building your own sorting alogrithm.

 

http://blog.sforce.com/sforce/2008/09/sorting-collect.html

crmexpertcrmexpert

i think i was unable to put it correctly..but what i meant was..

 

lastname, firstname ,gender, address

 

should be shown as

 

address, firstname, gender and lastname

 

now i think u shud get what i initially asked for :)