Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › What’s the best way to check if person accounts are enabled via Salesforce Apex Code?

    Tagged: Account Object, HTTP GET, isPersonAccount, Metadata in Salesforce, Person Accounts, Property in Salesforce, Salesforce Accounts, Salesforce Apex Code, Salesforce Bundle, Salesforce Certification, Salesforce sObject

    • Salesforce® Discussions

      What’s the best way to check if person accounts are enabled via Salesforce Apex Code?

      Posted by shradha jain on July 27, 2018 at 9:29 AM

      What’s the best way to check if person accounts are enabled via Salesforce Apex Code?

      Parul replied 7 years, 2 months ago 4 Members · 3 Replies
      • Account Object
      • HTTP GET
      • isPersonAccount
      • Metadata in Salesforce
      • Person Accounts
      • Property in Salesforce
      • Salesforce Accounts
      • Salesforce Apex Code
      • Salesforce Bundle
      • Salesforce Certification
      • Salesforce sObject
    • 3 Replies
    • Avnish Yadav

      Member
      July 30, 2018 at 6:00 AM

      Hello Shradha,

      Using isPersonAccount property on an Account and catch any exception that occurs if that property is missing. If an exception is generated then person accounts are disabled. Otherwise they're enabled. To avoid making person accounts required for the package you assign the Account object to an sObject and use sObject.get( 'isPersonAccount' ) rather than accessing that property directly on the Account object.

      Thanks.

    • shariq

      Member
      September 18, 2018 at 11:24 PM

      Hi,

      Try to access the isPersonAccount property on an Account and catch any exception that occurs if that property is missing. If an exception is generated then person accounts are disabled. Otherwise they're enabled. To avoid making person accounts required for the package you assign the Account object to an sObject and use sObject.get( 'isPersonAccount' ) rather than accessing that property directly on the Account object.

      This method takes ~3.5ms and negligible heap space in my testing.

      Hope this helps.

    • Parul

      Member
      September 22, 2018 at 12:32 PM

      Hi

      Method 1:
      Endeavor to get to the is Person Account property on an Account and catch any exemption that happens if that property is absent. In the event that a special case is produced then individual records are handicapped. Else, they’re empowered. To abstain from making individual records required for the (Salesforce Certification Training) bundle you allocate the Account protest a subject and utilize subject. Get (‘is Person Account’) as opposed to getting to that property straightforwardly on the Account question.
      This method takes ~3.5ms and negligible heap space in my testing.

      Method 2:
      Use the account meta-data to check to see if the isPersonAccount field exists. I think this is a more elegant method but it executes a describe call which counts towards your governor limits. It’s also slightly slower and uses a lot more heap space.

      Thanks

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    application solution

    Popular Salesforce Blogs

    Convert Accounts and Contacts to Leads Easily With the Blink App

    Blog in Salesforce Admin

    Converting accounts or contacts back to leads in Salesforce can be a challenging process as it goes against the standard Salesforce data model. That’s why ENWAY has…

    App Benefits, App Features, App Installation, AppExchange Marketplace, Attachments
    ENWAY Sep 7, 2023
    1,687  Views

    CPQ and CRM: The Best of both Worlds to Empower your Sales Teams

    Blog in Salesforce

    How efficient are your sales processes? While there may not be a definitive answer to this question, it makes us rethink our sales processes and…

    Configure Price Quote, CPQ, CPQ Analysis, CPQ Benefits, CPQ Consultation
    DemandBlue Mar 22, 2023
    1,249  Views

    Quote Templates in Salesforce: What Do You Need to Know to Use Them Right

    Blog in Salesforce Tools

    The C, P, and Q in CPQ stand for Configuration, Pricing, and Quote—a powerful combination that simplifies the proposal process. Creating accurate and professional-looking quotes…

    Branding Consistency, Business Software, Configure Price Quote, Configure Pricebook, CPQ
    Sculptor CPQ Jul 11, 2024
    823  Views

    Popular Salesforce Videos

    Salesforce JMS Integration Using MuleSoft | Salesforce Tutorial

    Salesforce JMS Integration Using MuleSoft | Salesforce Tutorial

    Video in Salesforce Training

    Salesforce JMS Integration. In this video, the following points will be covered - 1. Introduction Learn how to use queues to integrate data in Salesforce.…

    Salesforce Tutorial, Salesforce Video, Salesforce Learning, Mulesoft, Data
    Algoworks Jul 13, 2021
    2,239  Views
    How Cyntexa Helped Diet Meal And Food Ordering Service Providers Offer Their Users The Ability To Order Online | Salesforce Commerce Cloud

    How Cyntexa Helped Diet Meal And Food Ordering Service Providers Offer Their Users The Ability To Order Online | Salesforce Commerce Cloud

    Video in Salesforce Stories

    It is important to keep your business at the top with the latest technical advancements. Presenting you a case study showcasing how Cyntexa Helped Diet…

    Salesforce Training, salesforce, salesforce services, Salesforce Tutorials, Salesforce Video
    Cyntexa Jan 16, 2023
    1,013  Views
    How to Add Custom Fields on Custom Object in Salesforce?

    How to Add Custom Fields on Custom Object in Salesforce?

    Video in Salesforce Admin

    Watch this video to learn all about how to add custom fields on custom objects in Salesforce. If you have any doubts do let us…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    Prafull Feb 2, 2022
    2,230  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2025 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.