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

    Top 10 Salesforce Admin Tips in 2018

    Top 10 Salesforce Admin Tips in 2018

    Blog in Salesforce Stories

    No doubt, you might be the best Admin, but still, you will always look for tips to maintain the spark of being the best. When…

    Data Loader, emails, Field Level Security, Layouts, Reports
    Nirmal Sep 10, 2018
    3,228  Views

    How to Become a Salesforce Developer?

    Blog in Salesforce Career

    Salesforce, according to the producing company’s website, is “the world’s #1 customer relationship management (CRM) platform.” Their software is designed to help businesses grow by…

    Salesforce Apex, Salesforce App Builder, Salesforce Certification, Salesforce Course, Salesforce Developer
    Simplilearn Apr 12, 2019
    3,057  Views

    Learn Basics of How To Enhance Consumer Service With Salesforce Chatbots

    Blog in AI and ML

    When a company provides support, customers expect quick responses and resolutions, no matter their channel. Agents can only handle a limited number of cases at…

    audiences, Brand, build rapport, Business, Chatbot Conversations
    Apphienz Dec 6, 2022
    2,078  Views

    Popular Salesforce Videos

    Salesforce with Google Drive Integration

    Salesforce with Google Drive Integration

    Video in Salesforce Integration

    The Agenda of today's video is how to connect google drive with Salesforce using files connect. This Video is new in our learning video series…

    Salesforce Integration, Salesforce Consultant, Salesforce Consulting, Salesforce Integration Consultant, User Experience
    Prafull Mar 7, 2018
    2,933  Views
    Salesforce Service Cloud Voice Demo

    Salesforce Service Cloud Voice Demo

    Video in Salesforce Cloud Platform

    Salesforce Service Cloud Voice uses intelligent telephony to increase agent productivity and better serve customers, from anywhere. Today, customers can connect with companies across almost…

    Salesforce Service Cloud, salesforce, Salesforce Video, Telephony, Customers
    Jogender Jun 8, 2020
    2,497  Views
    Nonprofit Summit 2022 - Go Further with Salesforce Reports and Dashboards Hands-on Training

    Nonprofit Summit 2022 - Go Further with Salesforce Reports and Dashboards Hands-on Training

    Video in Salesforce Admin

    Salesforce reports and dashboards are the analytical sides of CRM. They are used to convert business requirements into Visual representations like Graphs, Pie Charts, Tables,…

    Salesforce Training, Salesforce Tutorial, Salesforce Reports, salesforce, CRM
    Jogender Jun 23, 2022
    2,208  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.