If I want to send an email to an user whenever a record is shared with him, how can I do so? More specifically, on what event should the email be sent?

  • You can query the shared records .share records will have userOrGroupId with whom it is shared and also the recordId so all you have to do is use messaging.email to send to the respective users. :) Click this link to start working Feb 21, 2017 at 5:32

1 Answer 1


There is no such event that you can use. The Share tables do not support triggers. You would have to periodically query the table on a schedule for new shares since the last check, then send the appropriate emails.

  • By table, do you mean AccountShare? Feb 23, 2017 at 7:39
  • I think all the Share tables would not support triggers, there is one for each object where manual sharing is enabled, e.g. AccountShare, MyCustomObject__Share, remember for custom objects it is a double underscore between the name and the 'Share'.
    – Dave Humm
    Feb 23, 2017 at 9:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .