I am studying "Apex Managed Sharing" but I have a problem with "Recalculating Apex Managed Sharing".
The Apex Developer Guide
says:
Every time a custom object's organization-wide sharing default access
level is updated, any Apex recalculation classes defined for
associated custom object are also executed.
I have created an Apex Class implementing Database.Batch
interface and I have assigned this class for my Custom Object.
If I start the Recalculation from UI the code run correctly but if I change OWD the code is not executed.
Best Answer
To associate an Apex managed sharing recalculation class with a custom object:
To run an Apex sharing recalculation, from the management settings for a custom object, go to Apex Sharing Recalculation, and then click New.
When working with Apex sharing recalculations, note the following.