In a experience site by self registration a user and a contact is created, an account (B) is also created but the contact is initally linked to a default Account (A) for new Users. After that I need to reassign the Contact to the Account created during self Registration, to do that I simply try to update the AccountId (A) of the Contact for the AccountId (B) of the Account that was created during the registration process, however when I try to do so i get the following error: UNKNOWN_EXCEPTION, portal account owner must have a role: []

However the role of the User was already set during the process of self registration with a User Role of CustomerPortal type linked to the default Account (A) for new users. What can I do to fix it? if I try first to create a UserRole for the new Account of type CustomerPortal for the new Account (B) i get an error saying the Account is not enabled for Customer Portal (field integrity exception: PortalType (Account is not enabled for this portal type): [PortalType] )

In addition, if i try to explicitly update the Accounts field "IsCustomerPortal" i get an excepction saying "Field cannot be explicitly set" or "Field is not writeable".

I am struggling to find a solution for this, as it is not really clear if when an Account is Customer Portal Enabled

1 Answer 1


"portal account owner must have a role" points to the Account Owner. So check who the owner of Account B is and whether they have a Role. This is required for Salesforce to be able to understand where to put the Portal Roles of that Account in the hierarchy

  • 1
    Thank you! That was indeed the issue, I set the owner Id of Account B to a User that has a role and then it was possible to change it. The UserRole of the Users Contact was also automatically updated and Account B was enabled as IsCustomerPortal
    – Juan Ge
    Commented Mar 24, 2023 at 14:06

You must log in to answer this question.

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