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
shekhar 46shekhar 46 

wrte apex code for polkicy object insert/update trigger

custom object : policy, fields( Policy Number,Agent(lookup to user),Policy Type - picklist (Personal,Business), Start Date, End Date),
Private access to policy in OWD, So that only owner can see the records,
When policy is created with policy type as business it should share record to agent selected in agent field.-> Use apex 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

So based on the agent field it should share the record to that user. Can you confirm what access need to be given for the record.

Thanks,