SALESFORCE-PD1 Process Automation And Logic Practice Question
A developer has a trigger that updates parent Account records when Child Contacts are modified. To prevent infinite recursion, the developer uses a static boolean variable in a helper class. What is a key limitation of using static variables for recursion control in Salesforce?
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
✓
Static variables reset at the end of each transaction, and do not protect against separate transactions or certain bulk test setups.
Static variables persist only for the duration of a single transaction; if a secondary transaction or test context restarts, the static variable resets.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Static variables persist across multiple user transactions, causing triggers to never fire again.
Why it's wrong here
Static variables do not persist across separate HTTP or transaction requests.
- ✗
Static variables cause governor limit exceptions on heap size.
Why it's wrong here
Static variables consume minimal memory unless storing large collections.
- ✓
Static variables reset at the end of each transaction, and do not protect against separate transactions or certain bulk test setups.
Why this is correct
Static variables are transaction-scoped and do not prevent recursive triggers if executed across multiple discrete transaction contexts.
- ✗
Static variables are prohibited in trigger helper classes.
Why it's wrong here
Static variables are commonly and validly used in helper classes for transaction-level recursion control.
About these practice questions
One of 493 original SALESFORCE-PD1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.