function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MoDiggityMoDiggity 

How to know if portals are enabled? User.ContactId; How to know if users are portal users?

I have a package that is failing now in orgs where there are > 1000 active users.  This happens when portals are enabled.

 

I can fix this by limiting my query to only grab users that are not portal users.  However, the field IsPortalEnabled on the user object only exists if portals are enabled in my org, it seems.  They are not enabled in my dev org.

 

I want to query on User.ContactId, but can't seem to find any information about whether this can be used for something other than portal users?

 

Also, I could also check to see if portals are enabled in the org, but can't seem to find that either.

 

Any help would be appreciated.

 

Thanks!

Vinita_SFDCVinita_SFDC

Hello,

 

You can query on User

 

List<User> userList = [select name from User where IsPortalEnabled = true];