Find your content:

Search form

You are here

Triggering to check for changes in org level sharing rules

 
Share

Does anyone have a solution for checking for changes in sObject__Share settings on particular objects in APEX


Attribution to: jordan.baucke

Possible Suggestion/Solution #1

There is a LastModifiedDate on the Share records. If you create a Datetime field on the SObject in question to record Last Sharing Modification Date, a comparison between the latest Share record and that date will tell you if anything has changed.

The other part of the trick is how to initiate that check, since you can't have a Trigger on Shares. If you need to know immediately when something is changed, the only way I can think of would be to replace the entire "Sharing" standard screen with some Visualforce. However, if checking periodically is good enough, you could have a Scheduled Class that looks for recently-modified Share records once a day or even more often.


Attribution to: Jeremy Nottingham
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/721

My Block Status

My Block Content