Portal user cannot edit own account and cannot create new contacts (portal users cannot own partner accounts)

create-recordscustomer-portaldigital-experienceerror-messages

I'm creating this question to share the errors i've found trying to enable Customer Portal Users to edit their Account record, and to create new Contact records, and the solution i've found. I do it here because i haven't found a direct and simple answer to understand how to fix the issues.

Let's assume you created your portal users with a profile that have CRUD access to Account/Contact objects.

Also, let's assume you have your Sharing Settings on Account and Contact as Private for "External Access".

Finally, your site Workspace > Administration > Preferences does not allow users to see other members of the site (so they cannot see other Customers nor mention them on chatter).

Error: Portal account owner must have a role.

Solution: You should be sure that all Account Owner Users (your internal SF users) have an assigned Role.

Error: Insufficient Privileges – when trying to edit the user Account or any related Contact record.

Solution: You must go to Feature Settings > Digital Experiences > Settings, and then go down to "Sharing Sets" and create a new Sharing Set. Give it the name you want, add the Profile you are using for your Community Users (i have a custom one so i can set object CRUD settings), select the objects (Account and Contact), and then they will appear down in the "Configure Access" table.

Sharing set from Digital Experiences Settings

You will see a "Set up" link on Account, press it and set the fields as follows:

Account Access Mapping

The repeat the same on Contact:

Contact Access Mapping

Error: portal users cannot own partner accounts – when creating new Contact.

Solution: You must create 2 Record-Triggered flows as follows:

You must add a Formula on both flows, this is important:

enter image description here

The first:

First flow 1

First flow 2

On the decision i'm using "CspLitePortal" as my Portal Users are using the "Customer Community Login" license. You must double check this!

First flow 3

Then you clear the Account field so the Contact could be created having the Portal User as Owner (later we will fix this on the second flow):

First flow 4

Remember to activate the flow.

Now on the second flow on the answer as i don't have enough reputation points.

Best Answer

Second flow 1

Second flow 2

The same decision (remember to add the formula to the flow):

Second flow 3

And now you set again the AccountId and change the owner to be the same of the Account:

Second flow 4

Remember to activate the flow.

Now your Portal Users should be able to create new Contact records.