Fatskills
Practice. Master. Repeat.
Study Guide: Salesforce Administrator - Audit Trail, Field History Tracking, and Setup Audit Trail
Source: https://www.fatskills.com/hesi/chapter/tech-salesforce-administrator-audit-trail-field-history-tracking-setup-audit-trail

Salesforce Administrator - Audit Trail, Field History Tracking, and Setup Audit Trail

By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.

⏱️ ~10 min read

Salesforce Administrator: Audit Trail, Field History Tracking & Setup Audit Trail

A hyper-practical, zero-fluff guide for real projects and certifications


1. What This Is & Why It Matters

You’re the Salesforce Admin for a mid-sized company. One day, your VP of Sales storms into your desk: "Someone changed the Close Date on the Acme deal from Q3 to Q4—now our forecast is wrong, and the board is furious. Who did this? When? And what else did they touch?"

Without Audit Trails and Field History Tracking, you’re flying blind. You’d have to: - Manually dig through emails or Slack messages (if they even exist). - Hope the user remembers what they changed (spoiler: they won’t). - Risk compliance violations (e.g., GDPR, SOX) because you can’t prove who accessed sensitive data.

This guide gives you three superpowers:
1. Audit Trail: A timestamped log of who changed what in Setup (e.g., profiles, sharing rules, custom fields).
2. Field History Tracking: A granular record of how a specific field’s value changed over time (e.g., Opportunity Amount, Case Status).
3. Setup Audit Trail: A 180-day rolling log of administrative changes (e.g., who deleted a user, modified a workflow).

Why this matters in production: - Compliance: Prove to auditors that data changes were authorized (e.g., "Yes, Jane updated the Contract Expiration Date on 5/15/2024 at 2:30 PM"). - Troubleshooting: Debug issues like "Why did this record disappear?" or "Who turned off validation rules?" - Security: Detect suspicious activity (e.g., a user suddenly exporting all Leads). - User Accountability: Stop finger-pointing ("I didn’t change that!"-"Actually, your username shows you did at 3:17 AM").

Real-world scenario: You inherit a Salesforce org with 50+ admins. A critical workflow rule breaks, and no one admits to touching it. Setup Audit Trail lets you pinpoint the exact change (and the culprit) in 2 minutes.


2. Core Concepts & Components

? Audit Trail (General)

  • Definition: A system-generated log of all changes made to data or metadata in Salesforce (records, fields, Setup configurations).
  • Production insight: Audit logs are not retroactive—enable tracking before you need it. If you turn it on after a breach, you’re too late.
  • Retention: Varies by type (see below). Setup Audit Trail keeps 180 days; Field History can be archived to Big Objects for long-term storage.

? Field History Tracking

  • Definition: Tracks changes to specific fields on records (e.g., Opportunity Amount, Account Billing Address). Logs the old value, new value, who changed it, and when.
  • Production insight: Not all fields are trackable. Standard objects support up to 20 fields; custom objects support up to 60. Pick wisely—tracking too many fields bloats storage.
  • Limitations:
  • Doesn’t track changes to formula fields (they’re calculated, not stored).
  • Doesn’t log system-generated changes (e.g., auto-number fields, workflow updates).
  • Text fields > 255 chars are truncated in the history.

? Setup Audit Trail

  • Definition: A 180-day rolling log of administrative changes (e.g., profile edits, sharing rule modifications, user deactivations).
  • Production insight: Critical for compliance and debugging. If a sharing rule breaks, Setup Audit Trail tells you who changed it and when.
  • Key events tracked:
  • User management (create, deactivate, freeze).
  • Profile/permission set changes.
  • Custom field/object creation/deletion.
  • Workflow/process builder/flow modifications.
  • Login attempts (successful/failed).

? Field History vs. Setup Audit Trail

Field History Tracking Setup Audit Trail
Tracks data changes (e.g., Opportunity Amount). Tracks metadata changes (e.g., who edited a validation rule).
Stored on the record (visible in the "History" related list). Stored in Setup (visible under "View Setup Audit Trail").
Retention: 18–24 months (depends on edition). Retention: 180 days.
Can be exported via reports or API. Can be exported via CSV or API.

? Big Objects (for Long-Term History)

  • Definition: A Salesforce storage option for archiving large volumes of data (e.g., Field History beyond 18–24 months).
  • Production insight: If you need 7+ years of history (e.g., for HIPAA), use Big Objects. Standard Field History won’t cut it.
  • Cost: Big Objects are cheaper than standard storage but require custom development to query.

? Event Monitoring (Advanced)

  • Definition: A paid add-on that logs user activity (e.g., report exports, API calls, login locations).
  • Production insight: Use this to detect data exfiltration (e.g., a user downloading all Contacts at 3 AM). Not covered in this guide, but worth knowing for security-focused roles.

3. Step-by-Step Hands-On

Task: Enable Field History Tracking on Opportunities

Prerequisites: - You have System Administrator permissions. - You’re using Salesforce Classic or Lightning Experience (steps are similar).

Step 1: Navigate to Field History Tracking Settings

  1. Click the Setup gear icon-Setup.
  2. In the Quick Find box, type Object Manager-click Object Manager.
  3. Select Opportunity-Fields & Relationships.
  4. Click Set History Tracking (top-right).

Step 2: Select Fields to Track

  1. Check the boxes for fields you want to track (e.g., Amount, Close Date, Stage).
  2. Pro tip: Track fields that impact revenue, compliance, or user accountability (e.g., Discount %, Probability).
  3. Click Save.

Step 3: Add the History Related List to the Page Layout

  1. In Object Manager, go to Opportunity-Page Layouts.
  2. Click Opportunity Layout (or the layout your team uses).
  3. Drag the Opportunity History related list onto the layout.
  4. Click Save.

Step 4: Verify Tracking Works

  1. Open an Opportunity record.
  2. Edit the Amount field (e.g., change from $10,000 to $12,000).
  3. Save the record.
  4. Scroll to the Opportunity History related list.
  5. You should see an entry like: Amount: $10,000-$12,000 Changed by: [Your Name] Date: [Today’s Date]

Step 5: Export Field History (Optional)

To export history for reporting:
1. Go to Reports-New Report.
2. Select Opportunity History report type.
3. Add filters (e.g., Date = Last 30 Days).
4. Run the report-Export as CSV.


Task: Download the Setup Audit Trail

Prerequisites: - You have View Setup and Configuration permissions.

Step 1: Access Setup Audit Trail

  1. Click the Setup gear icon-Setup.
  2. In Quick Find, type Audit Trail-click View Setup Audit Trail.

Step 2: Filter and Export

  1. Use the filters to narrow down:
  2. Date Range: Last 7 days (default is 180 days).
  3. User: Specific admin (e.g., "Jane Doe").
  4. Action: "Changed" or "Deleted".
  5. Click Download (CSV format).
  6. Example output: Date,User,Action,Section,Delegate User,Display 2024-05-15 14:30:00,[email protected],Changed,Profiles,,Changed "Standard User" profile 2024-05-15 14:25:00,[email protected],Deleted,Custom Fields,,Deleted "Opportunity.Custom_Field__c"

Step 3: Automate Setup Audit Trail Exports (Advanced)

Use the Salesforce CLI to fetch the audit trail programmatically:

# Authenticate (replace with your credentials)
sfdx force:auth:web:login -a MyOrg

# Query Setup Audit Trail (last 30 days)
sfdx force:data:soql:query -q "SELECT Id, Action, CreatedDate, CreatedBy.Name, Display FROM SetupAuditTrail WHERE CreatedDate = LAST_N_DAYS:30" -u MyOrg --csv > setup_audit_trail.csv

Why this matters: Automate exports for compliance audits or incident response.


4.-Production-Ready Best Practices

Security

  • Least privilege: Only grant View Setup and Configuration to admins who need it. Audit logs are sensitive!
  • Monitor for suspicious changes: Set up a Scheduled Report to alert on:
  • User deactivations.
  • Profile/permission set modifications.
  • Sharing rule changes.
  • Encrypt exports: If storing audit logs externally (e.g., AWS S3), encrypt at rest (e.g., AWS KMS).

Cost Optimization

  • Field History Tracking: Only track critical fields. Each tracked field consumes storage (~2 KB per change).
  • Big Objects for long-term storage: If you need 7+ years of history, archive Field History to Big Objects (cheaper than standard storage).
  • Setup Audit Trail: The 180-day retention is free, but if you need longer, export monthly and store in a data lake (e.g., AWS S3 + Athena).

Reliability & Maintainability

  • Naming conventions: Prefix custom fields with Hist_ if they’re used for tracking (e.g., Hist_Contract_Signed_Date__c).
  • Document tracking: Maintain a spreadsheet of which fields/objects have history tracking enabled (and why).
  • Test in Sandbox first: Before enabling tracking in production, test in a Full Sandbox to avoid performance issues.

Observability

  • Monitor storage usage: Field History consumes data storage. Check Setup-Storage Usage monthly.
  • Set up alerts: Use Salesforce Shield Event Monitoring (paid) or custom Apex triggers to alert on:
  • Mass record updates.
  • Unusual login activity (e.g., logins from new countries).
  • Log retention policy: Define how long you keep audit logs (e.g., "7 years for compliance, 1 year for troubleshooting").

5. Common Mistakes & Traps

Mistake Symptom Fix/Prevention
Not enabling Field History before an incident "We need to know who changed this field last month, but tracking wasn’t on." Enable tracking immediately for critical fields (e.g., Opportunity Amount, Case Status).
Tracking too many fields Storage costs spike; reports run slowly. Limit to 20 fields per object (standard) or 60 fields (custom). Prioritize compliance-critical fields.
Assuming Setup Audit Trail covers everything "Why can’t I see who changed this record?" Setup Audit Trail only tracks metadata (e.g., profiles, fields). Use Field History for record changes.
Not exporting Setup Audit Trail regularly "We need logs from 6 months ago, but they’re gone." Export the Setup Audit Trail CSV monthly and store in a secure location (e.g., AWS S3).
Ignoring system-generated changes "The history shows a change, but no user is listed." Field History doesn’t log system updates (e.g., workflows, flows). Use debug logs for these.

6.-Exam/Certification Focus

Salesforce Administrator Exam Tips

Typical Question Patterns

  1. "Which tool would you use to track who changed a validation rule?"
  2. Answer: Setup Audit Trail (tracks metadata changes).
  3. Trap: Field History Tracking (tracks record changes, not Setup).

  4. "How many fields can you track on a standard object?"

  5. Answer: 20.
  6. Trap: 60 (this is for custom objects).

  7. "A user says they didn’t change a record, but the history shows their name. Why?"

  8. Answer: They might have triggered a workflow/flow that updated the field.
  9. Trap: Assuming all changes are manual (system processes can log the user who triggered them).

  10. "How long is Setup Audit Trail retained?"

  11. Answer: 180 days.
  12. Trap: 1 year (this is for Field History in some editions).

  13. "Which of these fields can’t be tracked with Field History?"

  14. Answer: Formula fields (they’re calculated, not stored).
  15. Trap: Picklist fields (these can be tracked).

Key Trap Distinctions

Concept What It Tracks What It Doesn’t Track
Field History Changes to record fields (e.g., Opportunity Amount). Changes to metadata (e.g., validation rules).
Setup Audit Trail Changes to metadata (e.g., profiles, sharing rules). Changes to record data (e.g., Contact Phone).
Login History User login/logout events. What they did after logging in.

Scenario-Based Question

"You need to prove to an auditor that no one changed the Discount % field on Opportunities in the last 6 months. What do you do?" - Answer: 1. Check if Field History Tracking is enabled for the Discount % field. 2. Run an Opportunity History report for the last 6 months. 3. Export the report as a CSV for the auditor. 4. If tracking wasn’t enabled, explain that retroactive tracking isn’t possible (and enable it now for future audits). - Trap: Suggesting Setup Audit Trail (it won’t show record changes).


7.-Hands-On Challenge (with Solution)

Challenge

"A user claims they didn’t change the Stage of an Opportunity from 'Prospecting' to 'Closed Won,' but the history shows their name. How can you prove whether they did it manually or if a workflow updated it?"

Solution

  1. Check the Field History:
  2. Open the Opportunity-Opportunity History related list.
  3. Look for the change to Stage.
  4. If the "Changed By" field shows the user’s name, they manually updated it.

  5. Check Workflow/Flow Logs:

  6. Go to Setup-Debug-Logs.
  7. Filter for the user and time of the change.
  8. Look for a workflow/flow that updated the Stage.
  9. If a workflow triggered the change, the debug log will show: WORKFLOW_RULE: [Opportunity: Acme Deal] | Rule Name: Auto-Close Won Deals

  10. Conclusion:

  11. If the debug log shows a workflow, the user didn’t manually change it—the system did.
  12. If no workflow is found, the user manually updated the Stage.

Why this works: Field History logs the user who triggered the change, even if a workflow did the actual update.


8.-Rapid-Reference Crib Sheet

Field History Tracking

  • Max fields per object: 20 (standard), 60 (custom).
  • Retention: 18–24 months (depends on edition).
  • Enable via: Object Manager-[Object]-Fields & Relationships-Set History Tracking.
  • View history: Related list on the record (e.g., "Opportunity History").
  • Export: Reports-Opportunity History report type.
  • Doesn’t track: Formula fields, system-generated changes, text fields > 255 chars.

Setup Audit Trail

  • Retention: 180 days.
  • Access via: Setup-View Setup Audit Trail.
  • Export: CSV download.
  • Only tracks metadata: Profiles, fields, sharing rules (not record data).
  • CLI command: bash sfdx force:data:soql:query -q "SELECT Id, Action, CreatedDate FROM SetupAuditTrail WHERE CreatedDate = LAST_N_DAYS:30" -u MyOrg --csv > audit_trail.csv

Big Objects (Long-Term Storage)

  • Use case: Archive Field History beyond 18–24 months.
  • Cost: Cheaper than standard storage.
  • Query: Requires custom Apex or SOQL.

Storage Limits

  • Field History: ~2 KB per change.
  • Setup Audit Trail: No direct storage cost (part of Setup data).
  • Monitor: Setup-Storage Usage-"Field History" section.

9.-Where to Go Next

  1. Salesforce Help: Field History Tracking
  2. Salesforce Help: Setup Audit Trail
  3. Trailhead: Audit and Compliance
  4. Big Objects Developer Guide (for long-term archiving)

Final Pro Tip: "Audit logs are like a security camera—useless if you don’t check the footage. Set up a monthly reminder to review Field History and Setup Audit Trail for suspicious activity."