Salesforce Probable Lightning Interview Questions Part 1 (2022)

Salesforce Probable Lightning Interview Questions Part 1



1. Salesforce Lightning -

This includes Lightning Component Framework and some innovative tools for developers.
Lightning makes it easier to build responsive applications for any device.

The 3 main parts are:

Lightning components -
This is to accelerate development and app performance

Lightning App Builder -
This empowers admins to build Lightning pages without code just drag and drop.

Experience Builder -
This empowers admins to build communities visually, without code. 
This can further customized using lightning components.

reference - https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_lightning.htm



2. Ways to develop Lightning Components-

This can be using

Aura Components model OR Lightning web components model


3. Aura:

These are the self-contained and reusable units of an app. A component can contain other components, as well as HTML, CSS, JavaScript, or any other Web-enabled code. This enables you to build apps with sophisticated UIs.

reference -
https://developer.salesforce.com/docs/atlas.en-us.236.0.lightning.meta/lightning/intro_components.htm
trailhead- https://trailhead.salesforce.com/content/learn/modules/lex_dev_lc_basics


4. LWC:

This uses core Web Components standards and provides only what’s necessary to perform well in browsers supported by Salesforce. Because it’s built on code that runs natively in browsers, Lightning Web Components is lightweight and delivers exceptional performance. Most of the code you write is standard JavaScript and HTML.

reference - https://developer.salesforce.com/docs/component-library/documentation/en/lwc 


5. Tools to develop the components -

Aura components can be developed directly in Salesforce using the developer console or Visual Studio
LWCs can only be developed using Visual Studio

Salesforce recommends Visual Studio


6. Can Aura contain LWC or LWC contain Aura -

Aura components can contain and utilise LWCs, including communicating with them via events and component methods.
An LWC cannot be composed of Aura components, and they can only ever be its parent.


7. When to use these Aura or LWC -

Drag and drop components in Lightning App Builder Pages
Quick Action lauched via buttons on detail page
These can be exposed as tabs etc.
Utility bar
Flows
VF pages
etc.


8. 'this' keyword in lightning component -

 In Aura - We use the keyword from within our helper to reference other helper methods.
 In LWC - It is used to access any component property or method which points to calling context of the current code.


9. What is Lightning Data Service - 

This is to load, create, edit, or delete a record in your component without requiring Apex code.
This handles sharing rules and field-level security for us.

reference - https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/data_service.htm


10. What are the component bundles of the Lightning components?

Those are :
Controller: This handles the client-side events (js)
Documentation: This is used for recording the component’s use
Style: This includes component style (css)
Renderer: This contains a component default rendering behavior
Helper: Generic logic can be written in this component bundle used by different controller methods to avoid repetition. JavaScript functions that can be called from any JavaScript code in a component’s bundle
Component or Application : This contains markup for the component or app.
Design : File required for components used in Lightning App Builder, Lightning pages, Experience Builder, or Flow Builder
SVG File : This is used in the Lightning App Builder or Experience Builder.

reference: Custom icon resource for components used in the Lightning App Builder or Experience Builder.


11.  Use Lightning components with Salesforce1 Mobile App :

Make a lightning tab which points to the lightning component we created and then we have to include that tab in the salesforc1 Mobile Navigation select list and the newly created tab to it.


12. Types of Lightning Record pages -

Record page
App page
Homepage

reference - https://help.salesforce.com/s/articleView?id=sf.lightning_page_types.htm&type=5


13. Lightning Out -

This is to run components outside of Salesforce servers.
One of the advantage is that Lightning components can be utilized in a visual force page. It acts as a bridge to surface Lightning components in any remote web container.

reference - 
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lightning_out
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/lightning_out_considerations.htm
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/lightning_out.htm


14. Attributes in Aura:

These are typed fields that are set on a specific instance of a component, and can be referenced from within the component's markup using an expression syntax. Attributes enable you to make components more dynamic.

reference - https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_attributes.htm


15. Events -

A component registers that it may fire an event in its markup. Events are fired from JavaScript controller actions that are triggered by a user interacting with the user interface.

Component events are handled by the component itself or a component that instantiates or contains the component. It is used for interaction between the parent and child. The change in the child component can be communicated to the parent component through the component event.

Application events are handled by all components that are listening to the event. These events are essentially a traditional publish-subscribe model.
This is used to send modifications in the component to a wide audience. The components that have registered for this event will get an alert.


reference - https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_events.htm


16. Where can we display Lightning components -

Lightning Experience
Salesforce1 App
Standalone Lightning App
Visualforce Pages (Using Lightning out )
and many more...



17. Component Namespace -

Lightning components that Salesforce provides are grouped into several namespaces, such as aura, ui, and force. Components from third-party managed packages have namespaces from the providing organizations.

In our organization, we can choose to set a namespace prefix. If we do, that namespace is used for all of your Lightning components. A namespace prefix is required if we plan to offer managed packages on the AppExchange.

If we haven’t set a namespace prefix for your organization, use the default namespace c when referencing components that we’ve created.


reference - https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/namespaces_intro.htm#:~:text=Lightning%20components%20that%20Salesforce%20provides,to%20set%20a%20namespace%20prefix.



18. Difference between Salesforce classic and lightning-

Salesforce Classic is the original and older version whereas Salesforce Lightning is the new version that have several new features that aren’t available with ‘Classic’. Lightning Experience empower users to navigate the platform seamlessly and work with greater efficiency.

reference - https://help.salesforce.com/s/articleView?id=sf.lex_aloha_comparison.htm&type=5

Comments