OrgReady

Salesforce Skills & Readiness

Back to Practice
Apex TriggerDebuggingHard

Interview Challenge

Fix Recursive Trigger Re-entry

Debug an Account trigger that performs an update on the same records that caused the trigger to execute.

Challenge

Version 1

Inspect the evidence

Artifact / implementation

Review the supplied code, configuration or trace before proposing a fix.

trigger AccountTrigger on Account (after update) {
    List<Account> accountsToUpdate = new List<Account>();

    for (Account acc : Trigger.new) {
        acc.Description = 'Processed';
        accountsToUpdate.add(acc);
    }

    update accountsToUpdate;
}

Response workspace

Identify the issue, explain why it is a problem, and describe the fix. Include both your analysis and corrected solution below.

0 analysis characters

0 solution characters