Sub topic 16
Choosing the right mechanism and avoiding common mistakes
This chapter assumes you know org-wide defaults, the role hierarchy, public groups, sharing rules, manual sharing, teams, and share objects. It helps you pick one mechanism for a requirement and avoid the errors that cause most sharing problems.
Start from the requirement
Sharing only opens access. It cannot restrict it. So set the org-wide default to the most restrictive level any user needs, then open access in layers. Ask these questions in order:
- Does the access follow the reporting line? Use the role hierarchy.
- Does a defined set of users always need records owned by another set, or records matching a field value? Use an owner-based or criteria-based sharing rule.
- Does the access depend on the individual account, opportunity, or case? Use a team.
- Is it a one-off exception for one record? Use manual sharing.
- Does no declarative tool fit, or must the code decide who gets access? Use Apex sharing.
Compare the mechanisms
| Mechanism | Best for | Maintenance | Lifetime |
|---|---|---|---|
| Role hierarchy | Managers seeing subordinates' records | Low | Follows roles and ownership |
| Sharing rule | Stable, group-wide needs | Low, but recalculates | Persists until the rule changes |
| Team | Per-record collaboration | Medium, by users | Until the member is removed |
| Manual sharing | Rare exceptions | High, per record | Removed on owner change |
| Apex sharing | Logic that rules cannot express | Highest, code | Depends on the row cause |
Manual shares are lost when the record owner changes. Apex shares survive that change only if you use a custom row cause, which is declared on the share object. In the earlier example, RowCause.Manual behaves like the Sharing button, so it has the same limit.
Common mistakes
- Setting the org-wide default too open. You cannot take access back with a sharing rule. Lowering a default later affects every user at once.
- Using manual sharing as a process. If users share the same kind of record again and again, replace it with a rule or a team.
- Using many owner-based rules to mimic a hierarchy. Fix the role design instead.
- Targeting individual users. Share with public groups or roles so access changes when membership changes.
- Expecting a rule to apply instantly. Large changes start a recalculation, and the results may not appear until it finishes.
- Assuming sharing overrides permissions. A user still needs object read permission and field-level security. Sharing only gives record access.
Check before you build
Before creating a new rule, check whether an existing mechanism already grants the access. Then check what a new rule adds. A criteria-based rule such as Status__c equals Overdue shared with Finance_Managers is a good fit. The condition is stable, the audience is a group, and no one has to maintain it by hand.
Exercise
Sales reps own opportunities, but one specialist must help on a few large deals, and the set of deals changes every week. Which mechanism fits best, and why not a sharing rule?
Show answer
Use opportunity teams. The specialist's involvement varies per deal, so a team lets the owner or a user add and remove them with a team role and access level. A sharing rule suits a stable audience or a stable field condition. It would give access to every matching record, not only the few large deals. Manual sharing would also work for single deals, but it is lost when the owner changes and is tedious to repeat weekly.