Skip to content

Standard Before Custom

This content is not available in your language yet.

Module 1 of 6 in the chapter Reviewing a Security and Sharing Model, chapter 23 of Securing Salesforce: Sharing and Visibility. Each module stands on its own.

The question this module answers: When you review a security model, what’s the first thing you look for?

When I prepare people for the review board, I tell them the same thing every time: don’t get lazy and Apex-share everything. Use native Salesforce sharing everywhere you can. Only go to code when there’s no other way.

Chapter 11 module 1 turned that into questions for record sharing: do the defaults do it, does a rule, do teams or territories, does the data model, and only then does code write the shares. This chapter starts the review of the whole model with the same rule, because it holds at every layer of the course, not just for records.

So the first thing I look for in any security model is simple. Where did someone build something the platform already does?

Here’s the course, layer by layer, with the platform’s own mechanism and the custom one it should come before.

The layerReach for firstReach for lastWhere it’s taught
What people may doPermission sets and groups, built from each subsystem’s levelsPermission checks written into codeChapter 3
FieldsField-level securityHiding on a page layout, which isn’t security; a component that shows a locked fieldChapter 4
RecordsDefaults, hierarchy, rules, teams, territories, the data modelShares written by code or a flowChapters 5 to 11
Taking access awayRestriction and scoping rulesFilters in custom codeChapter 16
Outside usersExternal defaults, roles, sharing sets, share groupsCustom portal logicChapters 14 and 15
Codewith sharing, user modewithout sharing, system modeChapter 17
EncryptionShield Platform EncryptionThe Apex Crypto classChapter 18
WatchingEvent monitoring, transaction security, the default policiesCustom loggingChapter 19
AgentsThe agent user, Agent Access, actions scoped to the verified customerActions that read past their userChapter 20

Read down the last column and you’ve read the course. Every chapter taught both columns, and every chapter said the same thing about the order.

It isn’t a matter of taste. The platform’s mechanism keeps itself right, and custom work doesn’t.

When a rule shares a record, Salesforce keeps it current when the record changes, when the owner changes, when a new user joins the role. When code shares it, all of that is your job (chapter 11 module 1). The same is true at every layer:

  • It stays right when things change. Records, users, roles and releases all move. The platform’s mechanism moves with them; custom work moves only when someone remembers to change it.
  • It can be seen. A permission set, a rule, a restriction rule shows up in Setup, in the access summaries and in the evidence tools from chapter 13. A share written by code sits in a table, and a check written in code sits in a class.
  • It’s tested by Salesforce. Every release. Your custom version is tested by you, when you remember.
  • The next architect understands it. Somebody else will review this model one day. A standard model reads like the course. A custom one reads like a puzzle.

That’s why the review starts here. Every custom piece is a place where the model can drift without anyone noticing.

Sometimes the platform can’t do it, and custom is right. Here’s the case I use in class, and I’ve seen it on more than one exam: a HIPAA-level field that only the assigned rep may see, on a record other reps can still open (chapter 4 module 5).

Field-level security works by profile and permission set, not by record. So you lock the field down for everyone, because it needs to be secure. Then you build a component that runs in system context and shows the value only when the user is the assigned rep. It works. And it costs: it only works for display, so the edit has to happen somewhere else too, and now you own that component, its tests and its reason.

That’s what custom looks like when it’s right: standard tried first, at every layer, and only the gap built by hand.

So every custom piece in a model gets three lines in the review, the same way chapter 17 module 7 writes down every system-mode class:

  • What the standard mechanism couldn’t do, in one sentence.
  • Who owns it now, and who owns it next year.
  • How it’s tested, and what reruns the test.

If nobody can write the first line, it isn’t an exception. It’s a shortcut, and the review sends it back.

Standard before custom Standard before custom, layer by layer. Fields: field-level security first; a component that shows a locked field only if the standard can't do it. Records: defaults, hierarchy, rules, teams and the data model first; shares written by code last. Code: with sharing and user mode first; without sharing and system mode only with a written reason. Encryption: Shield first; the Apex Crypto class last. Agents: the agent user, Agent Access and actions scoped to the verified customer first; actions that read past their user last. Footnote: every custom piece gets three lines: what standard couldn't do, who owns it, how it's tested. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.60.0", "built": "2026-11-23", "id": "DGM-SVA-SR-01", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.5.0", "theme": "stevetecharc 1.5.0"} THE LAYER REACH FOR FIRST REACH FOR LAST Fields chapter 4 Field-level security by profile and permission set A component that shows it only when the standard can't Records chapters 5 to 11 Defaults, rules, teams the hierarchy and the data model too Shares written by code you keep them right Code chapter 17 With sharing, user mode the user's access Without sharing, system mode with a written reason Encryption chapter 18 Shield Platform Encryption The Crypto class data that must stay sealed Agents chapter 20 Scoped actions the agent user, Agent Access, the verified customer Actions past their user only as a narrow answer first only if not first only if not first only if not first only if not first only if not Every custom piece gets three lines: what standard couldn't do, who owns it, how it's tested. © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

Test knowledge. Know to prefer declarative, platform-maintained mechanisms over custom code at every layer: permission sets over code checks, field-level security over hiding, sharing rules and the hierarchy over Apex managed sharing, restriction rules over custom filters, with sharing and user mode over system mode, Shield over the Crypto class. Know what programmatic sharing costs: it must be maintained when records, users and the rules change. This supports the exam’s objectives across the course, from OBJ-1 to IMP-3. A likely area, not a known question.

  • For each layer of the model, whether the platform’s mechanism was tried first.
  • Which custom pieces stay, each with what standard couldn’t do, its owner and its test.
  • Which custom pieces go back to standard, and when.

Beyond the exam: what AI changes. An AI assistant reaches for code first, because code is what it writes best. Ask it the standard question before you accept its answer: is there a permission set, a rule or a setting that already does this?