My scenario is if some custom object X is related to the Opportunity using lookup,

On sharing the opportunity this custom object should be shared with the user or group with which opportunity is shared.

Custom object owd is private. Opporutnity owd is also private.

  • I dont think we can write trigger on share records – Mohith Shrivastava Jul 26 '13 at 6:43

If you make the object have a master-detail relationship to opportunity, it will automatically inherit the sharing of the opportunity object. If this isn't feasible, you'd have to write a script that periodically scans opportunity shares and replicates them to the custom object-- but this sharing wouldn't be real time, as we can't have triggers on share objects.


You should be able to allow the object to be shared to the group by creating an Apex sharing reason for your custom object under the Create -> Objects setting. I've linked to the Df wiki that seems similar to your issue.

Developerforce wiki citation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.