Skip to content

Instantly share code, notes, and snippets.

@karanrajs
Created February 26, 2015 17:14
Show Gist options
  • Save karanrajs/91fb2fad2d8d1de50cfb to your computer and use it in GitHub Desktop.
Save karanrajs/91fb2fad2d8d1de50cfb to your computer and use it in GitHub Desktop.
// Check to see if person accounts are enabled.
public Boolean personAccountsEnabled()
{
// Describe the Account object to get a map of all fields
// then check to see if the map contains the field 'isPersonAccount'
return Schema.sObjectType.Account.fields.getMap().containsKey( 'isPersonAccount' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment