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
javierjiesjavierjies 

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!!

javierjiesjavierjies
 

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.

 

 

 

Regards.

Dev-FoxDev-Fox
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