nerdexam
Salesforce

PDII · Question #81

PDII Question #81: Real Exam Question with Answer & Explanation

Sign in or unlock PDII to reveal the answer and full explanation for question #81. The question stem and answer options stay visible for context.

Question

A developer writes the following Apex trigger so that when a Case is closed, a single Survey record is created for that Case. The issue is that multiple Survey_c records are being created per Case. trigger CaseTrigger on Case (after insert, after update){ List<Survey_c> createSurveys = new List<Survey_c>(); for (Case c : trigger.new){ if (c.IsClosed && (trigger.isInsert II trigger.isUpdate && trigger.oldMap.get(c.Id).IsClosed == false)){ createSurveys.add(new Survey_c(Case_c = c.Id)); } } insert createSurveys; } What could be the cause of this issue?

Options

  • AA user is creating the record as Closed
  • BA workflow rule is firing with a Create Task action
  • CA workflow rule is firing with a Field Update action
  • DA user is editing the record multiple times

Unlock PDII to see the answer

You've previewed enough free PDII questions. Unlock PDII for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full PDII Practice