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
Alexia Marques 29Alexia Marques 29 

How to provide visibility to users based on field criteria?

How to provide visibility to records for users based on field criteria? My demand is: When I have some specific object Files with some specific products the users that are contacts in this accounts that has this products will see this register of Files. Like:
- I create a register on the object File with the field product fill with 'B'';
- The account with some specific record type also has the field product fill with 'B' and 'C';
- Because of that, the contacts (that are user in the community) present on this account will have access to the object File, because of the it's contains 'B'.

How to reach this solution? I think about a trigger on the object File that will check the accounts that contains the same product, and then, create a sharing rule for that, but I don`t know if is the best option and also, because of the limit of 300. It`s that any other way?
sai shanmukh vishnubhatlasai shanmukh vishnubhatla
Hi Alexia,

I'd use custom sharing vs sharing rules.
please go through mentioned link below.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htm
 
billy smith 1billy smith 1
This site https://steelseries.my.id/ is related about Technology and News, thank you for visit my page.