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
DevNVDevNV 

Creating Apex Sharing on insert - works internally but not for portal users

I'm building code to dynamically share a record with a portal owner's account's Executive Roles and Subordinates when a custom 'Job' record is created.  The code is working for me when the Job is created by an internal SF user, but when I try it as a portal user it fails.  The debug log shows it doesn't understand fields in the Job__Share object.  I thought that code called from a trigger is run with full permissions but it seems that the portal user can't access the sharing.  I've switched the code to a future call to see if that makes a difference but same error.

 

Has anyone else found a way to dynamically add apex sharing via actions from a portal user?