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
SKalidhasanSKalidhasan 

Sharing Rule and Custom Child Object

I have a requirement as below:

The Object Relationship is: DEAL (Parent, Private) -> WPV (Child) -> CHECKLIST (G Child) [All Master – Detail relationship]

The CHECKLIST Grand Child Object has a Field called Governance Lead which looks up to the standard USER Object.

I would like to share the CHECKLIST record with the User chosen in Governance Lead Field automatically when the record is saved. Can I achieve this?

kiranmutturukiranmutturu
yep you can do this by using apex managed sharing

go to the example of apex managed sharing the in the url

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_bulk_sharing_creating_with_apex.htm
SKalidhasanSKalidhasan
Thanks ...
I am thinking of the below...

[1] Move Governance Lead Field to DEAL Object
[2] Edit the Relationship Fields on both WPV, CHECKLIST Objects to give Edit access if the user has at-least Read on the parent record.
[3] For Specific Profiles whose Job Function is to only have Edit/Delete access to Child Records, Give only R (out of the CRUD) for the Parent custom Object DEAL while all the CRUD for WPV & CHECKLIST Child Objects
[4] Code a trigger to perform operations on DEAL__Share Object granting Read Access to Governance Lead.