• #24217
    Salesforce | Subodh Subodh #660
    Forcetalks

    Can we check when the Person Account was enabled in Salesforce Organization? If yes, how?

    Hello Everyone,

    Can we check when the Person Account was enabled in Salesforce Organization? If yes, how?

    Any help would be appreciable.

    Thanks,

    Subodh

     

    #24219
    Salesforce | Ashley Ashley #395
    Forcetalks

    Yes, you can check if Person Account is enabled in Salesforce org via Salesforce Apex code. Use this:

    boolean abc = Schema.sObjectType.Account.fields.getMap().containsKey( ‘isPersonAccount’ );
    system.debug(‘@@@’+abc);

    For more details, visit https://www.forcetalks.com/salesforce-topic/whats-the-best-way-to-check-if-person-accounts-are-enabled-via-apex-code/

    #24259
    Salesforce | Archit Archit #24
    Forcetalks

    Hello Subodh,

    Please try with below code might be it would be helpful.

    public class TestPersonAccount {
    public static Boolean personAccountsEnabled()
    {
    try
    {
    sObject testObject = new Account();
    testObject.get( ‘isPersonAccount’ );
    System.debug(‘Account Enabled’);
    return true;
    }
    catch( Exception ex )
    {
    System.debug(‘Account Disable’);
    return false;
    }
    }

    }

    #24310
    Salesforce | PRANAV PRANAV #681
    Forcetalks

    Hi Subodh,

    I think you want to know when your org Enables the Person Account. There is not a definite way to check it but you can run the below query to know when the Person Account record type is created.

    Select id,name,createdDate,SobjectType,IsPersonType FROM RecordType WHERE SobjectType=’Account’ AND IsPersonType=True

    As a new family of record types on Account objects is available: “person account” record types when person account is activated.

    Hope this helps you.

     

Viewing 4 posts - 1 through 4 (of 4 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?