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

Getting person account fields dynamically(very very very urgent)



  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....




Ashok Chandra


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.