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

Find records which newly out/in scope of user by Sharing Rules


There're standard SF API calls to getUpdated/Deleted records since some timestamp, but that just gives new or updated records in an object, right?

But let's say one record which previously was in scope for user as defined by sharing rules, now changed some field's value and became not visible to user.  Or it could be that just the sharing rule changed.

How can i get the records which became invisible for user since some amount of time? The same for records which just became visible.

The case is that i'm syncing data into offline storage, and at some point i need to clean it up from the data which became not visible for user per sharing rules.
Adnubis LLCAdnubis LLC
I am not sure how much this will help you but you should be able to get access to the Sharing Rules for those records. I have not actually attempted this myself but I have to imagine this could work for you. Here is an article that walks you through the process using apex for AccountShares. You should be able to apply this to what you are trying to do.