+ Start a Discussion
ashchanashchan 

Getting person account fields dynamically(very very very urgent)

hi,

  

  My task is to get person account fields dyanmically whether person account is activated or not in the instance...

 

  i would lie to show the fields in pick list....

 

 

Regards

Ashok Chandra

sfdcfoxsfdcfox

You can probably use Schema.Account.fields.getMap() to determine the list of fields available. If PersonContactId is present, Person Accounts are enabled. You can use Dynamic Apex (e.g. SObject.get and Sobject.put methods) to avoid the "hard-coded" compiling that will result in your class failing to deploy if these fields are not present.