Sub topic 11
Reviewing changes with the Setup Audit Trail
This chapter assumes you can open Setup, use Quick Find, and know that the Setup menu groups pages by category. You need a login to a Developer Edition org or a sandbox where you can see Setup.
What the Setup Audit Trail records
The Setup Audit Trail is a log of configuration changes made in Setup. Each entry records what changed, which Setup section it belongs to, when it happened, and who made the change. It covers changes such as creating a custom field, editing a permission set, or changing a password policy. It does not record changes to ordinary business data such as accounts or opportunities. That data has its own tools, such as field history tracking.
Use the trail when something stopped working and you need to know what changed recently. It also helps when you need to confirm who made a change.
Opening it in the browser
- Open Setup from the gear icon.
- In Quick Find, type
View Setup Audit Trail. - Select View Setup Audit Trail under Security.
The page lists the 20 most recent changes. Each row shows the date, the user, the section, and a description of the action. Click Download to get a CSV file of the last 180 days. Older entries are not kept in the trail.
Querying it with SOQL
The trail is also available as an object named SetupAuditTrail, so you can query it. This is useful for filtering by user or section, which the page does not let you do. Run the query in the Developer Console Query Editor, or with the Salesforce CLI.
SELECT Action, Section, Display, CreatedDate, CreatedBy.Name
FROM SetupAuditTrail
ORDER BY CreatedDate DESC
LIMIT 20The fields you will use most often are:
| Field | What it holds |
|---|---|
| `Action` | A short code for the kind of change, such as `createdCustomField` |
| `Section` | The Setup area the change belongs to |
| `Display` | A readable description of the change |
| `CreatedDate` | When the change was made |
| `CreatedBy.Name` | The user who made the change |
To narrow the results, add a WHERE clause before ORDER BY. For example, WHERE Section = 'Manage Users' shows only user-management changes.
Permissions and common errors
To see the trail you need the View Setup and Configuration permission. Without it, the page and the object are not available to you. Most administrators have it through their profile or a permission set.
These mistakes come up often:
- Looking for old changes. Anything older than 180 days is gone. If your team needs a longer history, download the CSV on a schedule and store it.
- Expecting data changes. A deleted record will not appear. Only configuration changes are logged.
- Reading
Displayas a full before-and-after. The text says what changed, but it often does not show the old and new values. Treat it as a pointer, then open the page it refers to. - Seeing a different user than expected. If an admin used "Login As" to act for another user, the entry may include a delegate user. Check the
DelegateUserfield to see who actually acted.
A short worked example
Suppose a validation rule on Opportunity stops users from saving records, and nobody knows why. Open the trail and look for entries with Section set to Customize around the time the problem started. A line such as "Changed validation rule" with a user name tells you who to ask and which rule to open. From there, go to Object Manager, select Opportunity, and open Validation Rules to inspect the current formula.
Exercise
A colleague says a permission set was edited three weeks ago and asks who did it. Name two ways to find out, and one reason the first might fail.
Show answer
Open View Setup Audit Trail and look for the entry, or download the CSV or query SetupAuditTrail with SOQL and filter by Section or date. The page shows only the 20 most recent changes, so a three-week-old entry may not appear there. In that case use the CSV download or a SOQL query, which cover the last 180 days.