Valid PDI Dumps shared by ExamDiscuss.com for Helping Passing PDI Exam! ExamDiscuss.com now offer the newest PDI exam dumps, the ExamDiscuss.com PDI exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com PDI dumps with Test Engine here:
A developer needs to prevent the creation of Request_c records when certain conditions exist in the system. A BequestLogic class exists that checks the conditions. What is the correct implementation?
Correct Answer: C
Option C implements abefore inserttrigger to prevent the creation ofRequest__crecords when specific conditions exist. It uses theaddErrormethod to display an error to users. Example of correct logic: trigger RequestTrigger on Request__c (before insert) { for (Request__c req : Trigger.new) { if (!RequestLogic.isValid(req)) { req.addError('Your request cannot be created at this time.'); } } } :Trigger Events in Apex