PDI · Question #139
A developer created a Lightning web component called statusComponent to be inserted into the Account record page. Which two things should the developer do to make the component available?
The correct answer is A. Add <isExposed> true</isExposed> to the statusComponent.js-meta ml file. B. Add <target> lighting _RecordPage </target> to the statusComponent.js-meta ml file. To make a Lightning Web Component available for use on record pages in Salesforce, the developer must set <isExposed>true</isExposed> and specify the appropriate target, such as <target>lightning__RecordPage</target>, in its meta-XML configuration file.
Question
A developer created a Lightning web component called statusComponent to be inserted into the Account record page. Which two things should the developer do to make the component available?
Options
- AAdd <isExposed> true</isExposed> to the statusComponent.js-meta ml file.
- BAdd <target> lighting _RecordPage </target> to the statusComponent.js-meta ml file.
- CAdd < masterLabel>Account</master Label> to the statusComponent.js-meta ml file.
- DAdd<target> Lightning_RecordPage </target> to the statusComponent.js file.
How the community answered
(28 responses)- A89% (25)
- C4% (1)
- D7% (2)
Why each option
To make a Lightning Web Component available for use on record pages in Salesforce, the developer must set `<isExposed>true</isExposed>` and specify the appropriate target, such as `<target>lightning__RecordPage</target>`, in its meta-XML configuration file.
Adding `<isExposed>true</isExposed>` to the component's `js-meta.xml` file is mandatory to make the Lightning web component visible and usable in the Lightning App Builder and on record pages.
Adding `<target>lightning__RecordPage</target>` to the `js-meta.xml` file specifies that the component is designed to be placed on a Lightning record page, making it available for that specific context.
While `<masterLabel>` is used to define the component's label in the App Builder, it does not directly control the component's availability on record pages.
The `<target>` tag and other configuration metadata must be defined in the component's `js-meta.xml` file, not directly within the `js` controller file.
Concept tested: LWC configuration for record pages
Source: https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_configuration_tags
Topics
Community Discussion
No community discussion yet for this question.