Salesforce Certified Platform Developer (Plat-Dev-201) PDI Question # 32 Topic 4 Discussion

Salesforce Certified Platform Developer (Plat-Dev-201) PDI Question # 32 Topic 4 Discussion

PDI Exam Topic 4 Question 32 Discussion:
Question #: 32
Topic #: 4

A developer needs to prevent the creation of Request__c records when certain conditions exist in the system. A RequestLogic class exists that checks the conditions.

What is the correct implementation?


A.

apex

CopyEdit

trigger RequestTrigger on Request__c (before insert) {

RequestLogic.validateRecords(Trigger.new);

}


B.

apex

CopyEdit

trigger RequestTrigger on Request__c (before insert) {

RequestLogic.validateRecords(trigger.new);

}


C.

apex

CopyEdit

trigger RequestTrigger on Request__c (before insert) {

if (RequestLogic.isValid(Request__c)) {

Request.addError('Your request cannot be created at this time.');

}

}


D.

apex

CopyEdit

trigger RequestTrigger on Request__c (after insert) {

if (RequestLogic.isValid(Request__c)) {

Request.addError('Your request cannot be created at this time.');

}

}


Get Premium PDI Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.