ForceChallenges
ProblemsDailyNotesInterview
Sign in

Practice

All problemsSOQL practiceApex trigger challengesDaily challengeOpportunityTrigger.oldMapBefore UpdateBulkificationContactValidationGROUP BYSemi-JoinAccountBefore Insert

Interview questions

All questionsAdminAdministrationApexApex TriggerAsync ApexDevelopmentField ServiceField ServiceIntegrationLwc

By company

DeloitteSalesforceAccentureInfosysPwCCognizant

Learn

Study notes

ForceChallenges

AboutContact usPrivacy PolicyTerms of ServiceFor AI assistants (llms.txt)
© 2026 ForceChallenges · Salesforce SOQL & Apex trigger practice
Admin questions45 of 50
AdminMedium 2 min read

How does Field History Tracking capture audit trails of user modifications for compliance and review?

Answer

Basics: For compliance and troubleshooting you need to know who changed a field and what it was before. You turn on tracking per object and per field; Salesforce then writes history rows automatically on every change after enablement.

How it works:

  1. Setup > Object Manager > object > Fields & Relationships > Set History Tracking.
  2. Check Enable (object) and select up to 20 fields (standard or custom), then Save.
  3. Add the History related list to the page layout (History related list / Account History).
  4. Each change creates a history record with Field, OldValue, NewValue, CreatedBy and CreatedDate.
  5. Query it through objects such as AccountHistory, CaseHistory, OpportunityFieldHistory, or MyObject__History for custom objects.

Advanced / deep dive: Only changes after enablement are captured; creation of a record is logged as a single "Created" entry. Some field types are not trackable or only show that a change occurred, for example long text areas, formula, auto-number and roll-up summary fields. History data does not count against data storage. Field Audit Trail (a Shield add-on) extends retention up to 10 years through a HistoryRetentionPolicy and allows up to 60 tracked fields per object. Standard Field History is not a general audit log: it does not track deletes of records (history disappears with the record), reads, or configuration changes; use Setup Audit Trail (180 days of setup changes), Event Monitoring or Shield Platform Encryption's related tooling for those. Reporting uses "<Object> with History" report types. Data is also available through the API for sync into a warehouse for long-term retention.

Code / config example:

sql
-- Who changed Opportunity Amount in the last 30 days?
SELECT OpportunityId, Field, OldValue, NewValue, CreatedBy.Name, CreatedDate
FROM OpportunityFieldHistory
WHERE Field = 'Amount' AND CreatedDate = LAST_N_DAYS:30
ORDER BY CreatedDate DESC

Hidden gotchas & must-remember points:

  • 20 tracked fields per object; Field Audit Trail raises this to 60.
  • Retention: 18 months in the UI, 24 months via API.
  • History is lost when the record is deleted (and the recycle bin retains data 15 days).
  • Changes made before tracking was enabled are not retroactive.
  • Long text and rich text changes are noted but old/new values are not stored.
  • Users need Read on the field to see its history values.

Best practice: Track only fields that matter for audit, export history regularly if you need longer retention, and consider Field Audit Trail for regulated data.

AdminField History TrackingAuditing
Practice SOQL & Apex
PreviousHow does Email-to-Case process incoming customer email messages to generate and update support cases?Next How do Validation Rules enforce data quality standards and display custom error messages to users?

More Admin questions

  • How do Dynamic Dashboards leverage running user security contexts to personalize dashboard data views?
  • What is a Hierarchical relationship and what unique object limitation does it possess in Salesforce?
  • What are Organization-Wide Defaults (OWD) and how do they establish baseline data security in Salesforce?
  • How does the Role Hierarchy interact with OWD settings to grant vertical record visibility?
  • What is the operational difference between owner-based and criteria-based sharing rules in Salesforce?