We have Role-hierarchy, sharing rule, Manual sharing. When we go for Apex sharing? what are the different situation we use?
-
Possible duplicate of SFDC: Understanding With Sharing, Without Sharing & Unspecified Sharing Classes– itsmebastiNov 30, 2017 at 18:22
-
That question doesn't seem a likely duplicate. It is about keywords.– Adrian Larson ♦Nov 30, 2017 at 18:24
-
1It doesn't duplicate the previous question but it is too broad and doesn't show any existing research.– Dave HummDec 3, 2017 at 20:52
1 Answer
Apex Managed Sharing is designed to allow developers to specify business rules in terms of special sharing. For example, perhaps sales users should only be able to see marketing material for active campaigns. Or maybe those sales promotions are shared to specific users based on their location or profile. Maybe support needs to see extra information for accounts that have specific service levels.
Organizations come up with all kinds of crazy rules about who can see what, and Apex Managed Sharing allows greater flexibility than the other half dozen or so sharing features that already exist.
It allows for flexibility beyond what standard features can offer. However, it should only be used when no other sharing feature fits the bill. Configuration before code. But it's a great feature to have when you need it.
-
-
4@RavindarAdmin You mean, besides the three examples I've already provided? Realistically, you may never have a use for it (I haven't had a need for it since it was a feature), but when you need it, you'll know. You will know because all of the other sharing features do not fit your needs.– sfdcfoxNov 30, 2017 at 19:55