Is there any way to identify if underlying org has customer Portal enabled, in apex ?

what I can think of is querying all the profiles and checking if UserType field has any of the below values, CSPLiteUser PowerPartner PowerCustomerSuccess CustomerSuccess

Is there any other way to do this ? Does this approach work for community ? would it continue to work if new types of portal/community licenses are added ?


You can query the Status of the Network object. If there's a community, there will be an Id. The Status will tell you whether it's Live, Down for Maint, or Under Construction. I believe you'll need to have “Modify All Data,” “View All Data,” or “Create and Set Up Communities,” to access the object. See the Object Reference for more.

  • I can't find "Network" object. I have customer portal in my org and no community. What is the exact name of the object ? – apn Nov 2 '15 at 18:02
  • 1
    Did you click on the link I provided? Network is the name of the object, but it only applies to Communities. For portals, you might look at the Site object and the field SiteType, but I'm not certain on that one. Portals are outdated and not nearly as well documented. The log-in was shared with Sites. – crmprogdev Nov 2 '15 at 18:10
  • Yes, I could find the Site object thx! – apn Nov 2 '15 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.