Salesforce Fact #620 | Access share object records in trigger
While changing the record owner, the sharing records with RowCause='Manual' gets deleted. If we want to access the records for some processing, we need to get them in before update context.
In this example, we have an account record with two manual share records. Now, in case of before update we get correct data from the AccountShare table, in after update the records have been deleted.
Attached are the screenshots.
Note: The code snippet is only for demonstration purpose and coding best practices have not been covered.
Comments
Post a Comment