PDI · Question #95
Uniersal Containers (UC) is developing a process for their sales teams that requires all sales reps to go through a set of scripted steps with each new customer they create. In the first steps of…
The correct answer is B. Future method D. Invocable method. This scenario requires a developer to implement components for an interactive, scripted process that involves an external REST endpoint callout and data presentation to the user.
Question
Uniersal Containers (UC) is developing a process for their sales teams that requires all sales reps to go through a set of scripted steps with each new customer they create. In the first steps of collecting information, UC's ERP system must be checked via as a REST endpoint to see if the customerexists. If the customer exists, the data must be presented to the sales rep in Salesforce. Which two should a developer implement to satisfy the requirements? Choose2 answer
Options
- AFlow
- BFuture method
- CTrigger
- DInvocable method
How the community answered
(35 responses)- A9% (3)
- B74% (26)
- C17% (6)
Why each option
This scenario requires a developer to implement components for an interactive, scripted process that involves an external REST endpoint callout and data presentation to the user.
While a Flow would orchestrate the scripted steps and call the Apex, the question asks what a *developer* should implement, pointing to the code components rather than the declarative orchestration tool itself.
A Future method is suitable for making asynchronous callouts to external ERP systems via a REST endpoint, as callouts often need to run in the background to avoid governor limits or block UI.
A Trigger executes automatically on record DML and is not designed for an interactive, guided screen flow that involves user input and immediate presentation of external data.
An Invocable method allows for custom Apex logic, including initiating a future method or directly performing a callout, to be executed from a Flow and return data for presentation within the sales rep's scripted steps.
Concept tested: Apex for Flow integration and asynchronous callouts
Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_future.htm
Topics
Community Discussion
No community discussion yet for this question.