Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Salesforce Certified Platform Developer II (PDII) · Salesforce
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
A. @future Explanation: When you need to perform a callout from within Apex—especially from a trigger—it must be done asynchronously. Using the @future annotation with the callout=true parameter enables callouts from asynchronous methods. In this scenario, each Account record's snapshot is sent to an external RESTful web service, and since the web service accepts only one record per call, the @future method can handle each Account individually in an asynchronous context. Why not B. Queueable: Queueable Apex offers additional features like job chaining and improved job handling, but these benefits are generally more useful in scenarios requiring complex processing or managing multiple related jobs. In this case, the processing is simple—making a single callout per record—so the added complexity of Queueable is unnecessary.
B is correct: The requirement states that a snapshot of Account records must be taken as they are saved and then sent to an external system. Since Apex triggers execute synchronously, a callout cannot be made directly. However, a Queueable class allows asynchronous processing with callouts using System.enqueueJob(). Since the external system can only receive one record per call, a Queueable job is a good fit because it allows each record to be processed individually. Why C is not correct: Process Builders cannot make HTTP callouts, making them unsuitable for this requirement.
i think it is C because if you use queueable either you make a for loop through the account list but it is limited to 50 queueable Or you chain the queueable but you should find a way to know which account you have processed, it means pass the list of account throught each queueable and remove the one that is processed before pass it to the next queueable you risk to be limited without a querylocator system and i am not sur it is possible due to then depth of the queueable that is limited