We have a specific sharing scenario that can't be solved with standard sharing rules. Our original solution was to use manual sharing, but because deactivated users lose access to any records that were manually shared with them, it may not work for our situation. I've been doing some research to see if Apex managed sharing would work for our purposes.
I am trying to figure out if Apex managed sharing is maintained if a user is deactivated (such that if they are reactivated, they would still have access to those records). I can't find anything mentioning caveats around user deactivation, which makes me think it would be maintained, but I want to be absolutely certain.
Michael Brown (Salesforce) Forum Ambassador
Hi Lindsey,
I also believe the Apex sharing rules will also remain when a user is deactivated, as manual shares and Apex Shares have a different RowCause to distinguish them. I would run a test to confirm. You could probably use the Developer Console to run some anonymous apex to share a record via Apex with a test user, then deactivate that user and see if the sharing record still exists.
Thanks,
Mikey