Sunday, 19 December 2021

Salesforce : RowCause in Share object

 RowCause is the reason why the share exists. There are a large number of reasons why shares may exist. 

A non-exhaustive list of standard shares are as follows:


Owner             - The user in OwnerId

Manual            - A manual share from the UI or code

Rule              - A sharing rule created this entry

ImplicitChild     - A parent record shares access with its children

ImplicitParent    - A child record shares access with its parent

ImplicitPerson    - Person Account Sharing (?)

Team              - The user is a member of a team (AccountTeam, OpportunityTeam)

Territory         - The user is in a given territory

TerritoryManual   - The record was manually shared to a territory

Territory2AssociationManual - The record was manually assigned to a territory

TerritoryRule     - A territory rule shared the record

Territory2Forecast - Territory forecasting calculations shared the record


Only manual shares and custom shares can be created, modified, and deleted, although some shares can also have their AccessLevel fields modified (e.g. Team sharing entries). 

All of the others are generated by the system based on sharing calculations. 

For example, the user specified by OwnerId automatically gains a sharing entry for Owner. 

You can't remove this entry because they own the record. Likewise, you can't add a new Owner this way. 

Instead, you would change the OwnerId field, and the system recalculates the Owner sharing entries based on that change.


I may have a few descriptions not quite right, and there may be some missing options; 

I simply pulled these values from the describe for the RowCause field and extrapolated based on my knowledge of Salesforce.

There's a lot of information about these various sharing settings in the documentation, but they're spread out across many topics. 

You'll want to do more research on it.


For anything other than manual shares, you must correct the situation that caused the share. 

For example, if the share reason is Team, then you must delete the appropriate AccountTeamMember or OpportunityTeamMember record.

No comments:

Post a Comment