function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JoyceJoyce 

Inserting into accountshare

so, SF won't allow you to insert a record into AccountShare if the user already hass access to that account? 

Please confirm.

For example, we have parent-child account relationships and want to propagage the account team from parent to all child accounts.  They all have different owners.

hence, I also need to add teh owner (rowcause=owner) of the paret account as a team member of the child account.  I have changed the rowcause = owner to "rowcause=team".  However, we get this error when trying to insert

Insert on AccountShare table row ca78800d4b714e34bb,00130000003zDeAAAU,00530000000dFM2AAM,All,Edit,Edit,Team,,

    Row error:

1 errors encountered in record :

Error code INVALID_ACCESS_LEVEL ()

 

benjasikbenjasik
Only type of row you can insert is a manual share.

Everything else is created implicitly (this includes owner sharing rows). The row has to be "non-trivial", that is it must grant more access than the default organization sharing level.

Team shares are done by inserting a record into AccountTeamMember. If you need more access than the default, you can then go update that record.
DevAngelDevAngel

Hi Joyce,

RowCause is not an updatable field.