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
jonathanrico.jonathanrico. 

Best way to handle duplicate sharing rules with Apex?

Hello everyone

 

I'm currently working with generating sharing rules dynamically using Apex.

 

I noticed that if I insert a sharing rule that has been defined previously there is no duplicate sharing rule inserted. Im guessing there's some logic that determines that an identical sharing rule has been defined and therefore it is not inserted. Am I right?

 

If this is the case, should I still verify that no duplicate sharing rules will be inserted o just rely on Force.com to avoid duplicate sharing rules for me?

 

Thanks in advance!