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, 4 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

    Web-to-Lead in Salesforce

    How to Set Up Web-to-Lead in Salesforce | The Complete Guide

    Blog in Salesforce Admin

    What is Salesforce Web to Lead  Salesforce web to lead is a tool for capturing and saving leads from your website. Salesforce has this capability…

    Code, Collect Data, Create Web-to-Lead Form, Desktop, HTML Code
    Avinash Patel Jun 3, 2022
    3,872  Views

    CRM Software Development Company: Empowering Businesses with Custom CRM Solutions

    Blog in Others

    In today’s highly competitive digital marketplace, customer relationships are more than just interactions—they're the foundation of success. Enter the CRM Software Development Company, the game-changer…

    Jennifer Aug 4, 2025
    1,250  Views

    No Code Tableau and Salesforce Integration

    Blog in Salesforce integration

    No Code Salesforce integrations are the best way to seamlessly integrate various software and platforms to boost productivity and enhance overall performance. With the new…

    Authentication Tab, Authentication Type, Best Practices, Boost Productivity, Businesses
    Apphienz Feb 1, 2022
    2,434  Views

    Popular Salesforce Videos

    How to Set Up Salesforce Knowledge?

    How to Set Up Salesforce Knowledge?

    Video in Others, Salesforce Training

    Watch this video to learn how to set up Salesforce Knowledge so you can help your team more easily find answers to common customer requests.…

    salesforce, salesforce knowledge, CRM, Salesforce Essentials, Salesforce VIdeos
    Nauman Mar 23, 2020
    2,839  Views
    Salesforce Checkout: Manage Your Subscription & Buy Licenses

    Salesforce Checkout: Manage Your Subscription & Buy Licenses

    Video in Salesforce Training

    Watch this video to understand how to manage your Salesforce subscription and buy licenses on your own. This makes an easy process even easier, this…

    Salesforce Video, Salesforce Essentials, Salesforce Learning, Salesforce Checkout, Small Businesses
    Neha Yadav Sep 23, 2020
    2,110  Views
    Benefits of Implementing Salesforce Revenue Cloud

    Benefits of Implementing Salesforce Revenue Cloud

    Video in Salesforce Cloud Platform

    Healthy revenue growth is a vital indicator of a firm’s success. The key aspects that majorly affect an organization’s revenue growth are sales, operations, finance,…

    Salesforce Training, Salesforce Video, sales, Salesforce Learning, Finance
    Algoworks Jun 3, 2021
    2,164  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

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