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
PRIYAN NEERUDUPRIYAN NEERUDU 

hi m already retriving a list of contactRecordTypes now i have to add dynamically 'all' option also to this in vf page...can anyone help me with dis

  contactRecordTypes= [Select ID, Name From RecordType Where sObjectType = 'contact'];
Shweta_AgarwalShweta_Agarwal
Hi Priyan,

Are you trying to show dynamic picklist of contact recordtype with 'all' value in vf page??

If I am correct below code can help you
 
public List<SelectOption> getContactRecType(){
        List<RecordType> contactRecordTypes= [Select ID, Name From RecordType Where sObjectType = 'contact'];
        List<SelectOption> optionList = new List<SelectOption>();
        optionList.add(new SelectOption('all','all'));
        for(RecordType rt : contactRecordTypes){
        	optionList.add(new SelectOption(rt.Name,rt.Name));    
        }
        return optionList;
    }

Thanks,
Shweta