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

    Salesforce Sales Cloud Implementation Guide

    Blog in Salesforce

    Implementing Salesforce Sales Cloud is one of the most effective ways for businesses to strengthen their sales operations, improve lead management, and boost revenue growth.…

    Cloud CRM Solutions, Sales Automation, Salesforce Consulting, Salesforce Sales Cloud Implementation, Salesforce Sales Cloud Services
    Dean Nov 24, 2025
    205  Views
    Essential features of Salesforce Marketing Cloud

    What Are the Three Essential Features of Salesforce Marketing Cloud?

    Blog in Salesforce

    Salesforce Marketing Cloud is the automation platform that receives the highest praise and boasts the greatest number of features of any product of its kind.…

    Cloud Venture, Contact Data, Customer Experience, Customer Experiences, Customer Journeys
    Hennery cavil Jan 30, 2023
    1,965  Views
    salesforce apple partnership

    Partnership of The Year – Salesforce Team Up With Apple!

    Blog in Others, Salesforce

    Salesforce and Apple are two popular tech giants who have simplified technology and contributed big time to the tech world. Salesforce is known as the…

    Apple, Apple News, Business, iOS App Development, mobile app development
    Algoworks Oct 29, 2018
    6,323  Views

    Popular Salesforce Videos

    MailChimp Salesforce Integration

    Video in Salesforce Integration

    The MailChimp and Salesforce integration allow you to start creating email campaigns from the leads and contacts in your Salesforce CRM. With the integration, it becomes easy to create list segmentation…

    Salesforce Training, Salesforce Integration, CRM, Salesforce CRM, Salesforce Video
    Deepika Aug 31, 2020
    1,943  Views
    Service Resources and Territories in Salesforce | Salesforce Webinar

    Service Resources and Territories in Salesforce | Salesforce Webinar

    Video in Salesforce Field Service Platform

    Ensure seamless field service operations by setting up Service Resources and Territories in Salesforce Field Service the right way. Organize and manage field service operations…

    Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Field Service Platform, Salesforce Field Service
    AblyPro Jun 26, 2024
    757  Views
    How to Track UTMs from Pardot Through to Salesforce Campaigns

    How to Track UTMs from Pardot Through to Salesforce Campaigns

    Video in Salesforce Training

    UTM parameters can be used to track the traffic from a variety of sources including email, social media, banner ads, and more. But how can…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    Abhishek Nov 9, 2021
    1,973  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.