Activities and Contracts
Det här innehållet är inte tillgängligt på ditt språk än.
Module 4 of 7 in the chapter Taking Access Away: Restriction and Scoping Rules, chapter 16 of Securing Salesforce: Sharing and Visibility. Each module stands on its own.
The question this module answers: Tasks, events and contracts are hard to make private with the sharing model. How does a restriction rule do it, and what still shows through?
When a student read me the list of objects that restriction rules work on, my answer was that Salesforce started with the safe stuff. Look at what’s on that list beside custom objects, though: tasks, events and contracts. Those aren’t there by accident. They’re the objects the sharing model has always struggled to keep private.
Why the defaults can’t do it
Section titled “Why the defaults can’t do it”Salesforce says it directly: “Access to contracts, tasks, and events can be difficult to make truly private using organization-wide defaults, making restriction rules the best way to configure this visibility” (Restriction Rules (opens in a new tab), Salesforce Help, checked 2026-11-26).
For activities, you already know why. Their default has two settings, Private and Controlled by Parent, and even Private means: “users with read access to the record to which the activity is associated can view and report on the activity” (chapter 12, module 6; also chapter 6, module 2). Anyone who can read the account can read every call and meeting logged against it. On a busy account, that’s a lot of people.
That’s fine until two groups who mustn’t see each other’s work share the same accounts.
Competing teams on one account
Section titled “Competing teams on one account”Salesforce’s own example: competing sales teams can’t see each other’s activities on the same account, and “With restriction rules, you can make sure that sales teams see only activities that belong to them and are relevant to their work” (Restriction Rules). Its developer guide builds the same thing as its quick start: “a restriction rule that controls which tasks members of the Sales Team can access” (Quick Start: Control Which Tasks the Sales Team Can Access (opens in a new tab), Restriction Rules Developer Guide, checked 2026-11-26).
Picture the kitchen equipment maker from chapter 15 with two sales teams: one sells equipment, one sells service plans, and they’re paid on different numbers. Both work the same restaurant accounts, and both need to read those accounts. But the service team’s calls about pricing shouldn’t be on the equipment team’s screen, and the other way round.
The account has to stay readable. So the sharing model can’t separate them. A restriction rule can, on tasks and events, because it filters what the account opened:
- If each team is one role, Salesforce’s example fits as it is: events “owned by users that have the same role,” by comparing the owner’s role with the current user’s role (Restriction Rule Example Scenarios (opens in a new tab), Salesforce Help, checked 2026-11-26).
- If a team spans several roles, use module 2’s habit: a Team field on the task or event, filled by a flow from its owner, and a rule that compares it with the user’s own team.
Remember module 3 too. That’s one rule per object for the sales teams, on tasks and again on events, and it has to be the only one that matches each of them.
Confidential services
Section titled “Confidential services”Salesforce’s second example is the one I’d think about most carefully: “if you provide confidential services to various individuals, use restriction rules so that only team members responsible for supporting these individuals can see related tasks” (Restriction Rules). Think of a care team, a legal team, a wealth adviser: the tasks themselves say something private about a person. A rule keeps them to the team that owns the relationship, even though the person’s record is visible to more people.
What still shows through
Section titled “What still shows through”Activities are where restriction rules have the most edges. Read this list before you promise anyone that a rule makes their activities private (Restriction Rule Considerations (opens in a new tab), Salesforce Help, checked 2026-11-26):
- Calendars with Show Details. “In calendars, if the Show Details access level is selected, users can see the subject of all events, regardless of the restriction rules created.” Chapter 12 showed how users open their calendars to each other; that door goes around the rule.
- Subordinates’ events. “Users can see their subordinates’ events in calendars even if the users have an active restriction rule applied.”
- Chatter posts. “If a user creates an event or a task record using the Chatter publisher, the record name is visible in the related Chatter post. Restriction rules don’t restrict visibility to these record names.”
- Search shortcuts. “After restriction rules are applied, users can still see records that they previously had access to in the global search box shortcuts.” Clicking one gives an error, but the name was on the screen.
- Activity related lists. “Use the Activity Timeline instead of activity related lists, such as Open Activities or Activity History.” Rules on tasks and events that use fields not on those lists’ objects “don’t work in any activity related lists,” and the lists “display at most 50 records, and restriction rules are applied after,” so a user can see fewer than 50 when more exist.
- Group events. “Don’t create rules on Event.IsGroupEvent, which indicates whether the event has invitees.”
Notice what most of these have in common. They show a subject or a name, not the record. For many requirements that’s acceptable. For a confidential service, a subject line like “Call about the custody hearing” is the leak. Know which kind of requirement you have, and write subjects to match.
Contracts, and what hangs off them
Section titled “Contracts, and what hangs off them”Contracts are the third hard object, and they bring a different edge: the records underneath. “Creating a restriction rule for an object doesn’t automatically restrict access to its child objects.” Notes on a restricted contract, for example, stay as they were; secure child records with other sharing mechanisms (Restriction Rule Considerations).
So a rule that hides a contract from the regional sales teams (module 2’s example) doesn’t hide the notes and files attached to it. Chapter 12 covers files and the other cabinets (chapter 12, module 2); check every kind of record hanging off a restricted contract.
And one more that surprises people: “Users can’t clone records that have a lookup to a record that they can’t see due to a restriction rule.” Cloning an order that looks up a hidden contract, for example, ends in an error (same page). Expect a support ticket the first week, and put it in your release notes.
Test knowledge. Know that Salesforce calls restriction rules the best way to make contracts, tasks and events private, because org-wide defaults can’t, and that its example is competing sales teams on the same account. Know the activity edges: event subjects show in calendars with Show Details; users see subordinates’ events in calendars; record names show in Chatter posts from the publisher; search shortcuts show previously seen records; use the Activity Timeline rather than Open Activities and Activity History; don’t build rules on Event.IsGroupEvent. Know that a rule doesn’t restrict child objects, such as a contract’s notes, and that users can’t clone a record that looks up to one they can’t see. A likely area, not a known question.
What an architect decides here
Section titled “What an architect decides here”- Which groups must not see each other’s activities or contracts, even on accounts they both read.
- Whether a team is one role (Salesforce’s same-role pattern) or needs a team field on the activity, filled by automation.
- Whether calendar sharing, Chatter posts and search shortcuts can show subjects and names for this requirement, and if not, what goes in a subject.
- That users work from the Activity Timeline, not the older activity related lists.
- How child records of a restricted contract, its notes and files, are protected, and what users are told about the clone error.
Beyond the exam: what AI changes. Agents read activities to summarize an account: the last calls, the next meetings. A restriction rule on tasks and events keeps one team’s activities out of the other team’s agent answers, as long as the agent runs as the user. But an agent that reads Chatter, calendars or email can still meet the subjects and names this module lists. Test the agent with a question that only the other team’s activities could answer. Chapter 20 covers agents.
Explore
Section titled “Explore”- Restriction Rules (opens in a new tab), Salesforce Help (checked 2026-11-26)
- Restriction Rule Considerations (opens in a new tab), Salesforce Help (checked 2026-11-26)
- Restriction Rule Example Scenarios (opens in a new tab), Salesforce Help (checked 2026-11-26)
- Quick Start: Control Which Tasks the Sales Team Can Access (opens in a new tab), Restriction Rules Developer Guide (checked 2026-11-26)
