We have person accounts in our org. to whom we need to give access to our customer community at various stages of an opportunity.

Is there a way we can programmatically enable our person accounts as customer users using apex ?

We have Customer Community Login licenses available in our org.

1 Answer 1


You can create Customer Community User programmatically using apex by assigning Customer Community Profile and set ContactId of the user to account.PersonContactId;

 newUser.ContactId = account.PersonContactId ;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .