This post will talk about Salesforce Lightning Interview Questions & Answers. Here are some scenario-based Salesforce lightning interview questions. Check our Top Salesforce Developer Interview Question post for more questions related to Apex.
What is the use of force:hasRecordId interface?
Add the force:hasRecordId interface to a Lightning component to enable the component to be assigned the ID of the current record. The current record ID is useful if the component is used on a Lightning record page, as an object-specific custom action or action override in Lightning Experience or the Salesforce app, and so on. This interface has no effect except when used within Lightning Experience, the Salesforce mobile app, and template-based communities.
For more details refer below link force:hasRecordId
1 Explain Attributes, and what are the required parameters in the attribute definition?
Attributes are variables that we use for storing the values. We must define the Default, Type, Name, Access, and Description in the attribute definition. In the attribute definition, only Name and Type are the required parameters.
What are the different programming models available for Lightning components?
There are 2 different programming models available for Lightning components. The first is utilising the Aura framework to build out Aura components, the second is utilising the newer Lightning Web Components (LWC) framework.
4 What are the options for the lightning record page assignment?
We can assign the lightning pages at three distinct levels:
1 Differentiate Component Event and Application Event?
We use the component event for interaction between the parent and child. We can communicate the change in the child component to the parent component through the component event. We use Application events to send any modification in the component to a wide audience. The components registered for this event will get an alert.
|Related Article: Salesforce for Beginners|
The AuraEnabled annotation allows the lightning components for accessing the Apex properties and methods. AuraEnabled annotation is overloaded, and we use it for distinct purposes.
2 What tools can we use to ease our development?
There are several tools Salesforce provides for us to assist in development regardless of whether we are developing Aura components or LWC. The most notable of which is the SFDX extensions for VSCode, which provide us an IDE experience, far better than that of the Developer Console.
1 Explain force: record data?
The force: record data is a conventional controller of the lightning component. We can accomplish the operations like deleting, creating, and editing a record through force: record data. If we want to use force: record data, it removes and recognizes the replicate request passing to the server if we request for the same record data.