Salesforce Fact #881 | Community user check using ContactId on User

We can make use of ContactId field in User object to identify if the current logged in user is a community user or not. The same can be used in LWC.

Attached is the screenshot.


Note: The ContactId field cannot be updated manually and while trying to do so, the below error is encountered:

'You can't create a contact for this user because the org doesn't have the necessary permissions. Contact Salesforce Customer Support for help.'

Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow