ExamGecko
Question list
Search
Search

Question 8 - Certified B2B Commerce Developer discussion

Report
Export

Which code statement should a developer use to import the ID of the current Lightning Experience

A.
import id from '@salesforce/network/ld'
Answers
A.
import id from '@salesforce/network/ld'
B.
import id from '@salesforce/experience/ld'
Answers
B.
import id from '@salesforce/experience/ld'
C.
import id from '@salesforce/site/ld'
Answers
C.
import id from '@salesforce/site/ld'
D.
import id from '@salesforce/community/ld'
Answers
D.
import id from '@salesforce/community/ld'
Suggested answer: D

Explanation:

To import the ID of the current Lightning Experience community, a developer should use the following code statement:

import id from '@salesforce/community/Id';

The @salesforce/community module allows the developer to access information about the current community, such as its ID, name, URL, and base path. The other modules do not exist or are not related to the community ID. The @salesforce/network module is used to access information about the current network, such as its ID and name. The @salesforce/experience module is used to access information about the current user experience, such as whether it is standard or custom. The @salesforce/site module is used to access information about the current site, such as its name and prefix. Salesforce

Reference: [Lightning Web Components Developer Guide: Import Community Information], [Lightning Web Components Developer Guide: Import Salesforce Modules]

asked 23/09/2024
Kanik Sachdeva
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first