Convert single-user accounts associated with sites to use a shared person account role. A shared person account role is one role that the platform creates and assigns to all external role-based users that are in a single-user account.
Important If you have a large number of business accounts that have a single
Experience Cloud site user, we recommend enabling account role optimization (ARO). With ARO
enabled for an external role-based user who is the only external role-based user on the
account, only one role is created and assigned to the user. Without ARO, the default number of
account roles (1 to 3) is created and assigned to the user. The fewer number of roles, the
better the performance of your site.
The PortalRole field in the User object is used to specify user roles.
- To use shared person account roles, enable account role optimization.
-
To update an Experience Cloud site user role and convert the user to the shared person
account role, use code as shown in this sample Apex code.
User u = new User(); u.Id = '<user id>'; u.PortalRole = 'PersonAccount'; update u;