Portal Account Owner Must Have a Role: Fixes in Setup, Record, and Apex

If Salesforce is telling you the portal account owner must have a role, the fix is to assign a role to the user who owns the account tied to that contact, then retry enabling the external user. The error appears because Salesforce uses the account owner’s position in the role hierarchy to calculate what an external user is allowed to see, and a blank role leaves it with nothing to work from. The fix itself takes under a minute once you know which record to open.

Why the Role Is Required

External users (customer portal, partner portal, and Experience Cloud users) inherit their data visibility from the account owner’s spot in the role hierarchy. Without a role on the owner, there’s no anchor point for the sharing model, so Salesforce blocks the enable action at the platform level. Permission sets and profile changes won’t bypass it. You have to put the owner somewhere in the hierarchy.

Fix It From the Account Record

This is the fastest path when you’re dealing with one contact.

Go back to the contact and try enabling the external user again. The error should clear.

Fix It From Setup

If you’re correcting several account owners at once, work from Setup instead of bouncing through account records.

In Lightning Experience, go to Setup, then Users under Administration. In Salesforce Classic, it’s Setup, then Manage Users, then Users.1Salesforce Help. Error “Portal Account Owner has No Role” on Customer User Activation Find the user, click Edit, pick a role, and save. Same fix, different door.

When the Error Comes From a Flow or Apex

The same validation fires when a Flow or Apex trigger creates an external user, so the error can show up in a debug log or an automation failure notice instead of on screen. There’s a second requirement that trips people up in this context: the user running the Flow or executing the Apex must also have a role, not just the account owner.2Salesforce Help. Error “Portal account owner must have a role” when you enable an External User The message only names the account owner, so most admins check that record first and stop there. If the owner already has a role and the automation still fails, look at the running user next.

Picking the Right Role

Any role will clear the error, but the one you pick controls what external users on that account can see going forward. External users sit below the account owner in the hierarchy. They can see records owned by or shared with users at or below the owner’s level. Users above the owner can roll up and see the external user’s activity; users in parallel branches generally cannot.

Place the owner too high and external users may inherit visibility into records they shouldn’t reach. Place the owner too low and managers who need oversight of portal activity will be locked out without extra sharing rules. If the account runs a high-volume portal or touches sensitive data, check the hierarchy before you save.