You need to sign in to do that
Don't have an account?

Is Salesforce Org Enabled for Person Account
I need an Apex function which determines if the Salesforce Org where is runs is enabled for the Person Account Type.
Has someone any ideas how to do this.
Thanks,
Sten
nope by default person account is not enabled to org..you need to request salesforce to activate person account first... then you can use recordtype object to check whether your org is enabled with person account or not
You can retrieve the metadata of the account object and check for standard PersonAccount fields ...
Map<String, Schema.SObjectField> accFieldMap = Schema.sObjectType.Account.fields.getMap();
if(accFieldmap.get('IsPersonAccount') != null){
// here we go ... this or has PersonAccount enabled
}else{
// here we go ... this or has not PersonAccount enabled
}
Cheers,
--dirk
I know this is a rather old message but I've found that it's approximately twice as fast to try to access the person account field via an sObject and then catch the exception if the field is missing. It also avoid using a describe call since those are limited by the governor, though the limit is pretty high now at 100.
From my testing this method takes ~3.5ms whereas using a describe call to test this takes ~7ms. This method also uses a lot less memory: ~5k for this version vs. ~100k for the describe version.
Here's the code I'm using:
Here's an optimized version of the describe call method to check for person accounts: