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
Apex Trigger questions27 of 32
Apex TriggerEasy 1 min read

In which trigger events are Trigger.old and Trigger.oldMap available?

Asked atAccentureDeloittePwC

Answer

Trigger.old and Trigger.oldMap are available in before update, after update, before delete, and after delete triggers.

They are not available in insert or undelete triggers because there is no prior version of the record. Both are read-only; attempting to modify them throws an error.

apex-triggertriggercontext-variables
Practice SOQL & Apex
PreviousWhy is Trigger.newMap not available in before insert?Next In which trigger events are Trigger.new and Trigger.newMap available?

More Apex Trigger questions

  • How do you write a test class to achieve 100% code coverage and meaningful assertions for bulk triggers (testing with 200+ records)?
  • How do you handle UNABLE_TO_LOCK_ROW errors triggered during high-volume updates on parent records?
  • Does with sharing or without sharing on a Trigger Handler class affect SOQL and DML executed from the trigger?
  • Under what user context do Apex Triggers run (System Mode vs User Mode)?
  • How do Platform Events and Change Data Capture (CDC) triggers differ from standard SObject triggers?