PDI practice question 13 of 30
Universal Containers recently transitioned from Classic to Lightning Experience. One of its business processes requires certain values from the…
Full set: 201 questionsThe requirement is to initiate an HTTP REST callout when a user clicks a custom button on an Opportunity record page in Lightning Experience. Both Quick Actions using a Visualforce page and a Lightning Component are valid methods to achieve this. A Visualforce quick action (A) allows an Apex controller to be invoked, which can perform the callout. This method is supported in both Classic and Lightning Experience. A Lightning component quick action (C) is the modern, Lightning-native approach. The component's JavaScript controller calls an Apex method annotated with @AuraEnabled(cacheable=false callout=true) to perform the callout. Both solutions fulfill the core requirement of a user-initiated callout from a button.
B. "Remote Action" is not a standard Salesforce automation tool in this context. More importantly, the action is triggered on every record update, not by a specific button click as required.
D. An Apex trigger fires automatically in response to a data manipulation language (DML) event (e.g., record update), not from a user explicitly clicking a button on the user interface.
1. Lightning Component Quick Actions (Option C):
Lightning Web Components Developer Guide, "Configure a Component for Quick Actions". This guide explains how to expose a Lightning web component as a quick action, which appears as a button on a record page.
Apex Developer Guide, "Invoking Callouts Using Apex". This section details how Apex controllers, which can be called from Lightning components, are used to make HTTP callouts. Specifically, it notes that callouts cannot be made from methods where cacheable=true.
2. Visualforce Quick Actions (Option A):
Salesforce Help, "Create Object-Specific Quick Actions". Under the "Action Type" section, it lists "Custom Visualforce" as a valid type for an object-specific action, which can be placed on page layouts.
Visualforce Developer Guide, "Making Asynchronous Callouts". This document explains that callouts can be made from the Apex controller of a Visualforce page, which is the mechanism used by a Visualforce quick action.
3. Why Triggers are Incorrect (Option D):
Apex Developer Guide, "Triggers". The first paragraph states, "Apex triggers enable you to perform custom actions before or after events to records in Salesforce, such as insertions, updates, or deletions." This confirms triggers are tied to DML events, not UI actions.
Keep practicing
Take the free PDI practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other PDI practice questions
- Question 1What can be used to override the Account's standard Edit button for Lightning Experience?
- Question 4Universal Containers (UC) wants to lower its shipping cost while making the shipping proc…
- Question 5A developer has an integer variable called maxAttempts. The developer needs to ensure tha…
- Question 7Universal Containers wants to back up all of the data and attachments in its Salesforce o…
- Question 8Universal Containers hires a developer to build a custom search page to help users find t…
- Question 9As part of new feature development, a developer is asked to build a responsive applicatio…
