function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

APEX sharing assignment to "Portal Role"??



I am trying to develop a trigger on a custom object ("Order"), that will automatically share the object with the current user's "Portal Role and Subordinates" on insert/update.

I am able to add the user itself to the "sharing" list via APEX, but have been unable to find a way to instead add the user's "Portal Role and Subordinates" to the sharing list via the APEX trigger.

Is it even possible to access the portal roles in this way via APEX triggers? If not, does anyone know of any workaround?




Thanks in advance. 




Were you able to solve this requirement. Please let me know if you have found any alternative. I am also looking for the same.



Prudhvi kamal.