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
AsaktiAsakti 

record visibility based on approval process

Hi All, 

there are 3 profiles ,
1.Admin
2.Sales user
3.Unit User

sales user creates a record  i.e. RecordA in a child object of opportunity which is having an approoval process and once it is approved by the Admin(only)  then only the Unit user should be able to see  the  RecordA not before.

How to achieve it?how to check and where to check if this configured in system.

I checked in approval process there is no such rule,and also checked in profiles
Unit user have - read access only
Sales user - read,create ,edit
PriyaPriya (Salesforce Developers) 
Hi Asakti,

You can use Apex manage sharing. 

1. Create a field on your record to set record is approved or not.
2. In trigger, check if this field is updated and selected as approved
3. Perform apex manage sharing and give access to required user.
 

Please mark it as the Best Answer so that it can help others in the future.

Regards,

Priya Ranjan