Toggle Side Panel

  • Blogs
  • 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
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • 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
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › What is the best way to check if organization has Person Account enable or not using Salesforce Apex?

    Tagged: Account Object, Boolean, isPersonAccount, Person Account, Salesforce Apex, Salesforce Organization, Salesforce sObject

    • Salesforce® Discussions

      What is the best way to check if organization has Person Account enable or not using Salesforce Apex?

      Posted by Aman on September 22, 2018 at 9:40 PM

      What is the best way to check if organization has Person Account enable or not using Salesforce Apex?

      Parul replied 8 years, 2 months ago 3 Members · 2 Replies
      • Account Object
      • Boolean
      • isPersonAccount
      • Person Account
      • Salesforce Apex
      • Salesforce Organization
      • Salesforce sObject
    • 2 Replies
    • shariq

      Member
      September 22, 2018 at 9:41 PM

      // Test to see if person accounts are enabled.
      public Boolean personAccountsEnabled()
      {
      try
      {
      // Try to use the isPersonAccount field.
      sObject testObject = new Account();
      testObject.get( 'isPersonAccount' );
      // If we got here without an exception, return true.
      return true;
      }
      catch( Exception ex )
      {
      // An exception was generated trying to access the isPersonAccount field
      // so person accounts aren't enabled; return false.
      return false;
      }
      }

    • [adinserter block='9']
    • Parul

      Member
      September 23, 2018 at 5:28 AM

      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.

    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

    Popular Salesforce Blogs

    Salesforce Consulting Partner

    What Are The Benefits of A Salesforce Consulting Partner

    Blog in Salesforce Consultant, Salesforce customization, Salesforce Implementation

    Salesforce Consulting services help the organizations to fulfill their business needs by assisting them in projects like Salesforce implementation, data integration, customization, AppExchange, and many more.…

    AppExchange, Automated Processes, Best Tools, Business Flow, Certified Salesforce Company
    Micropyramid Aug 28, 2020
    5,978  Views

    Real Salesforce ADM-201 Practice Exams to Build Confidence 2025

    Blog in Others

    Mastering the Salesforce Certified Administrator ADM-201 Exam with Passcerthub The Salesforce Certified Administrator (ADM-201) test is a crucial step for professionals who want to succeed…

    Jaessica Aug 1, 2025
    1,509  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
    LevelShift (formerly DemandBlue) Mar 22, 2023
    1,611  Views

    Popular Salesforce Videos

    Get Ready for a More Connected Partner Experience | Salesforce Partners

    Get Ready for a More Connected Partner Experience | Salesforce Partners

    Video in Salesforce Stories

    Your destination for a connected partner experience is the Partner Community. Get Ready For an Enhanced and Personalized Experience. Watch this video and learn more…

    Salesforce Training, Salesforce Video, Salesforce Learning, Salesforce Partners, Connected Partner Experience
    Rupal Kakkar Mar 16, 2021
    1,991  Views
    Salesforce: Everything You Need to Know About Order Management

    Salesforce: Everything You Need to Know About Order Management

    Video in Salesforce Training

    THE GOAL: Which Salesforce Order Management application is best? Well, that depends…. Salesforce offers three primary applications for order management, and they all work extremely…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Learning, Business
    Abhishek Jul 12, 2022
    1,994  Views
    Salesforce Winter 18 Release for Busy Admins

    Salesforce Winter 18 Release for Busy Admins

    Video in Marketing

    Contents: Lightning Report Builder Dashboard Report Filter Lightning Hover Components Conditional Page Components Setup Search in Lightning Lead Conversion Updates User Interface Settings

    Salesforce Administration, Salesforce Admin Training, Salesforce Lightning, Salesforce Lightning Experience, Salesforce Lightning Components
    Shiv Kumar Sharma Feb 9, 2018
    2,096  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®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.