We have Role-hierarchy, sharing rule, Manual sharing. When we go for Apex sharing? what are the different situation we use?


1 Answer 1


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.

  • Can you give a example , When we use? Nov 30, 2017 at 19:13
  • 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.
    – sfdcfox
    Nov 30, 2017 at 19:55

Not the answer you're looking for? Browse other questions tagged .