Sub topic 2
The building blocks of an approval process
This chapter assumes you know basic Salesforce Setup, objects and records, and how users, roles, and queues work. It names each part of an approval process and shows how the parts fit together. Later chapters configure each part in detail.
The parts at a glance
An approval process is a saved definition attached to one object. It has five kinds of parts:
| Part | What it does |
|---|---|
| Entry criteria | Decides which records may enter the process |
| Initial submitters | Decides who may submit a record |
| Approval steps | Define the ordered stages a record passes through |
| Approvers | Name the people or groups who respond at each step |
| Actions | Run automatically at defined points, such as submission or final rejection |
You create the process in Setup under Approval Processes. You pick the object first, then the process definition. Each object can have several processes, but only active processes run.
How the parts connect
A record enters the process only if it meets the entry criteria and the submitter is allowed to submit it. The record then moves through the steps in order. Each step has its own approvers. When the last step finishes, the record is finally approved or finally rejected, and the matching actions run.
Entry criteria and submitters
Entry criteria are conditions on the record, such as Amount > 10000. You can write them as field filters or as a formula. A record that fails the criteria cannot be submitted to this process. Initial submitters limit who may submit. By default the record owner can, and you can add other users, roles, or groups.
Steps and approvers
Each step can have its own criteria. If a record does not meet a step's criteria, you choose what happens: skip to the next step, approve the record, or reject it. Within a step, approvers can be specific users, a queue, or a user named in a field on the record, such as the record owner's manager. A step with several approvers needs a rule: all must approve, or the first response decides.
Actions
Actions fall into two groups of timing. Some run at fixed points: initial submission, final approval, final rejection, and recall. Others run after an individual step is approved or rejected. The action types are field update, email alert, task, and outbound message. The process also locks the record while it is pending. Locking is a built-in behavior, and the chapter on record locking covers it.
Active and inactive definitions
A process must be activated before records can be submitted. Once a process is active, Salesforce restricts changes to it, and you must deactivate the process to edit most of its parts. Deactivating a process with pending requests can affect those requests, so check for pending items first.
Putting it together
Suppose an opportunity over 10,000 needs a manager's sign-off:
- Entry criteria:
Amount > 10000. - Initial submitter: the opportunity owner.
- Step 1: the owner's manager approves.
- Initial submission action: a field update sets
Discount_Status__ctoPending. - Final approval action: a field update sets the status to
Approved. - Final rejection action: a field update sets the status to
Rejected, and an email alert tells the owner.
Exercise
A record meets a step's criteria in none of your steps, and you did not set any fallback. Which two parts of the process definition decide whether the record can be submitted at all?
Show answer
The entry criteria (the record must meet them) and the initial submitters (the user must be allowed to submit). Step criteria only affect how the record moves after submission.
Exercise
Name the four action types an approval process can run, and give two points at which they can run.
Show answer
Field update, email alert, task, and outbound message. They can run at initial submission, final approval, final rejection, recall, or after an individual step is approved or rejected.