CRT-450 practice question 4 of 30

A developer needs to make a custom Lightning Web Component available in the Salesforce Classic user interface Which approach can be used to accomplish this?

Full set: 201 questions
Answer options
A: Embed the Lightning Web Component is a Visualforce Component and add directly to the page layout.
B: Use the Lightning Out JavaScript library to embed the Lightning Web Component in a Visualforce page and add to the page layout. Correct answer
C: Use a Visualforce page with a custom controller to invoke the Lightning Web Component using a call to an Apex method.
D: Wrap the Lightning Web Component in an Aura Component and surface the Aura Component as a Visualforce tab.
Correct Answer:
B. Use the Lightning Out JavaScript library to embed the Lightning Web Component in a Visualforce page and add to the page layout.
Explanation

The officially sanctioned method for displaying a Lightning Web Component (LWC) within the Salesforce Classic UI is to use the Lightning Out JavaScript library. This technology is specifically designed to surface Lightning components (both Aura and LWC) in an external container, such as a Visualforce page. The process involves referencing a Lightning dependency app from the Visualforce page and then using the $Lightning.use() and $Lightning.createComponent() JavaScript functions to dynamically create and display the component within the page. This Visualforce page can then be embedded into a standard page layout in Classic.

References

1. Lightning Web Components Developer Guide: The section "Use Lightning Web Components in Visualforce Pages" details the process. It explicitly states

"To use a Lightning web component in a Visualforce page

embed it in a Lightning Aura component. Then

use Lightning Out to surface the Aura component in Visualforce." This confirms that Lightning Out is the core technology (supporting B) and that an Aura wrapper is a necessary step (making D a partial but less complete answer).

Source: Salesforce

Lightning Web Components Developer Guide

"Use Lightning Web Components in Visualforce Pages".

2. Lightning Aura Components Developer Guide: The "Communicate with a Visualforce Page" section describes the use of $Lightning.createComponent(). It states

"Dynamically create a component on a page by calling $Lightning.createComponent() after the Lightning Out app has loaded." This highlights the central role of the Lightning Out JavaScript library.

Source: Salesforce

Lightning Aura Components Developer Guide

"Lightning Out Dependencies"

"Communicate with a Visualforce Page".

3. Visualforce Developer Guide: The documentation on tag confirms its purpose: "Use this component to include Lightning Components for Visualforce in a Visualforce page." This tag is the entry point for using the Lightning Out library within Visualforce.

Source: Salesforce

Visualforce Developer Guide

"Component Reference"

.

Scroll to Top