Salesforce Platform Developer I (legacy) — Question 166
Universal Containers recently transitioned from Classic to Lightning Experience. One of its business processes requires certain values from the Opportunity object to be sent via an HTTP REST callout to its external order management system based on a user-initiated action on the Opportunity detail page. Example values are as follows:
* Name
* Amount
* Account
Which two methods should the developer implement to fulfill the business requirement? (Choose two.)
Answer options
- A. Create a Visualforce page that performs the HTTP REST callout, and use a Visualforce quick action to expose the component on the Opportunity detail page.
- B. Create a Process Builder on the Opportunity object that executes an Apex immediate action to perform the HTTP REST callout whenever the Opportunity is updated.
- C. Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action to expose the component on the Opportunity detail page.
- D. Create an after update trigger on the Opportunity object that calls a helper method using @Future(Callout=true) to perform the HTTP REST callout.
Correct answer: C, D
Explanation
Option C is correct because a Lightning component can be seamlessly integrated into the Lightning Experience and can perform HTTP callouts. Option D is also correct as it uses an after update trigger to invoke a method that allows callouts to be made asynchronously. Options A and B are not suitable because Visualforce components are not the best fit for Lightning Experience, and Process Builder does not support callouts directly without asynchronous actions.