I have Custom Sharing rule

In After Insert trigger. I don't get public group Ids or User ids shared through custom sharing rule.

List<Objcet__Share> sharedUsers = [select Id, ParentId, AccessLevel, UserOrGroupId, RowCause from Objcet__Share where parentId = recordId];

This list returns only one record that is the owner of the record but actually, two groups are assigned to this through custom sharing.

1 Answer 1


As per this guide. sharing rule will be execute after trigger. try separate the transaction with @future . Try run the same in developer console and check whether actual two groups are assigned.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .