I have the following code which creates a CaseShare for a Partner Community User to share all cases across an Account. The UserOrGroupId is set to the Group of type 'RoleAndSubordinates' that is associated with the PartnerRole on the account using the 'RelatedId' field on Group.
CaseShare share = new CaseShare(); share.CaseAccessLevel = 'Read'; share.UserOrGroupId = strgroupId; share.CaseId = caseId; share.RowCause = 'Manual';
The code runs succesfully and returns an Id of the CaseShare record but I can't view it in SOQL even as System Administrator. I tried omitting the RowCause and it makes no difference. Also the rule does not seem to grant the access intended.