What should a Salesforce architect recommend to make sure that users that gained access to a custom object record through Apex managed sharing do not lose access to it when its owner is changed?
What should a Salesforce architect recommend to make sure that users that gained access to a custom object record through Apex managed sharing do not lose access to it when its owner is changed?
To make sure that users who gained access to a custom object record through Apex managed sharing do not lose access to it when its owner is changed, a Salesforce architect should recommend creating a specific Apex Sharing Reason for the custom object. This ensures that the sharing reason is independent of record ownership and therefore remains intact when the owner changes.
B. A way to grant access that won't be removed when the owner changes is by using Apex to create Share records with a specific "RowCause" or Sharing Reason.
C. When Apex managed sharing is used, it allows you to programmatically share records with other users or groups based on specific criteria. However, this sharing mechanism is not automatically maintained when the owner of a record changes. Therefore, to retain the shared access even if the owner changes, a new sharing entry with RowCause set to "Manual" should be created in the _Share object. This way, the sharing entry becomes independent of the record owner and is not affected by ownership changes.
Manual shares written using Apex contains RowCause="Manual" by default. Only shares with this condition are removed when ownership changes. B.
It's B, if you set a specific rowCause, sharing won't be removed. C is valid but it's a waste of time