+ Start a Discussion

Issue with sharing

Hello everyone!!




Is there any way to make a sharing of a record by a user who is not the owner of the record?


Thanks in advance!!


I mean, using an Appex trigger we like to add a record in sharing table. The user who update the record that trigger the appex is not the owner so the trigger fail.

We would like to know is it possible to run a trigger from the owner of the record despite the user that modify the record that trigger "the trigger" had only read/write access.





You cannot run as some other user but you can share access to record modified user.
For apex . sharing: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htm