There is a scenario in which an opportunity is created by a Sales User.Hence in this case the Opportunity Owner is the Sales User. This opportunity needs to be teamed up with other sales user so that incase the first one is not avaialble, the other could follow up on the opportunity. This will result into split of the sales commission used for reporting purpose.
One way to achieve this through Opportunity Teams, however it is not only the Opportunity that needs to be made accessible to the other sales user. Opportunity is related to other custom objects through lookup and master-detail relationship. The related list records also needs to be made accessible to the sales user .Please note the OWD for Opportunity and other custom objects is currently set to PRIVATE meaning the owner of the record will only have access to their own records.
In such a case, we can have a lookup field to the user object on the opportunity and make use of Apex Sharing Trigger ( After insert , After update) to share the opportunity record with the other sales user based on the value of the lookup field.
Is it also possible to share the records of the Opportunity related objects ( custom objects) as mentioned above in the same trigger or is there some other way to handle such a scenario? Please advise.