SALESFORCE-PD1 Developer Fundamentals Practice Question
An application has complex business logic where an Apex class called from a trigger needs to know whether it was invoked from an insert or update trigger context. How can the developer determine this?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Check Trigger.isInsert and Trigger.isUpdate boolean variables.
Trigger.isInsert and Trigger.isUpdate context variables indicate whether the current trigger execution was caused by an insert or update operation.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Query the Audit Trail object for the active transaction ID.
Why it's wrong here
Querying Audit Trail is asynchronous and extremely slow for runtime logic.
- ✓
Check Trigger.isInsert and Trigger.isUpdate boolean variables.
Why this is correct
These context variables accurately reflect the trigger execution event.
- ✗
Check if Trigger.old is null; if null, it is always an update.
Why it's wrong here
If Trigger.old is null, it indicates an insert, not an update.
- ✗
Inspect the exception stack trace using System.debug().
Why it's wrong here
Stack traces do not reliably expose the exact DML event type.
About these practice questions
This SALESFORCE-PD1 question is part of Courseiva's 488-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Salesforce exam blueprint
This SALESFORCE-PD1 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SALESFORCE-PD1 exam.