Salesforce Lightning Interview Questions and Answers

Q1 : What is an aura definition bundle?
A : A bundle contains an Aura definition and its related resources. The definition can be a component, application, event, interface, or a tokens collection.
An AuraDefinitionBundle component is a folder that contains definition documents. In contrast to most other metadata parts, an AuraDefinitionBundle component is not a single file, it’s a collection of files. Each record or file is a resource in a bundle, for example, markup, applications, code records (including controllers and helpers), events, documentation, and interfaces.

Learn SalesForce to Unleash a Modern Career

Join SalesForce Training

 

Q2 : Would we be able to incorporate external JavaScript/CSS libraries like jQuery, bootstrap in components?
A : Yes, Indeed, we can utilize various libraries in our lightning components like JQuery, Bootstrap, custom CSS, and custom Javascript libraries using a static resource.

Q3 : What is Lightning Design System?
A : Style guides and modern enterprise UX best practices to build pixel perfect apps that go with the look and feel of the Lightning Experience and Salesforce1 Mobile app.

Q4 : Component events vs Application events. Which one should I use?
A : Component events can be handled only by components above them in the containment hierarchy, therefore, their usage is localized to the components that need to know about them.
Application events are best used for something that should be handled at the application level, like navigating to a specific record. Application events allow communication between components which are in separate parts of the application and have no direct containment relationship.

Q5 : What is a FlexiPage in lightning?
A : FlexiPage represents the metadata associated with a Lightning page. A Lightning page represents a customizable screen made up of regions containing Lightning components.
A Lightning page can contain up to 25 components. The Flexi page is stored as an XML file and can be deployed using metadata API or any deployment tool.
Lightning pages are referred to as FlexiPages in API and referred to as Lightning pages elsewhere in SFDC documentation.

Q6 : How can we display loading spinner in the lightning component?
A : Spinners are CSS loading indicators that should be shown when retrieving data or doing slow computations. lightning:spinner displays an animated spinner image to indicate that a request is loading. This component can be used when retrieving data or performing an operation that takes time to complete. The aura:waiting and aura:donewaiting can be used for controlling the loading spinner.

Q7 : What is Locker Service in Salesforce Lightning?
A : Locker Service is a powerful security architecture for Lightning components. Locker Service enhances security by isolating Lightning components that belong to one namespace from components in a different namespace. Locker Service also promotes best practices that improve the supportability of your code by only allowing access to supported APIs and eliminating access to non-published framework internals.

Q8 : How to get current record id in the lightning component?
A : Add the force:hasRecordId interface to a Lightning component to enable the component to be assigned to 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.

Q9 : How to create a popup in the lightning component?
A : Modals/Popup Box are used to display content in a layer above the app. This paradigm is used in cases such as the creation or editing of a file, as well as various types of messaging and wizards.

Q10 : What are the List of Global value providers in lightning?
A : These are the list of Global value providers in lightning:

• $globalID
• $Browser
• $Label
• $Locale
• $Resource

Learn SalesForce to Unleash a Modern Career

Join SalesForce Training

Q11 : What are the different Lightning component bundles?

A : The different Lightning component bundles are:

a. Component
b. Controller
c. Helper
d. Style
e. Document
f. Design
g. SVG
h. Rendrer

Q12 : Is Lightning an MVC framework?

A : No, it’s a component-based framework.

Q13 : How can we use Lightning Components with the Salesforce Mobile App?
A : For this purpose, we need to first make a lightning tab that 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.

Q14 : What are the tools included in lightning?

A : The tools included in lightning are as follows:

  • Lightning Component Framework – Components and extensions that allow you to build reusable components, customize the Salesforce1 Mobile App, and build standalone apps.
  • Lightning App Builder – A new UI tool that lets you build apps lightning fast, using components provided by Salesforce and platform developers.
  • Lightning Connect – An integration tool that makes it easier for your Force.com app to consume data from any external source that conforms to the OData spec.
  • Lightning Process Builder – A UI tool for visualizing and creating automated business processes.
  • Lightning Schema Builder – A UI tool for viewing and creating objects, fields, and relationships.

Q15 : What is Lightning?

A :Lightning is the collection of tools and technologies behind a significant upgrade to the Salesforce platform. Lightning includes:

  • Experience: A set of modern user interfaces optimized for speed. This includes the Lightning Experience, Salesforce1 Mobile App, and template-based communities.
  • Lightning Component Framework: A JavaScript framework and set of standard components that allow you to build reusable components to customize the Lightning Experience, Salesforce1 Mobile App, and template-based communities and build your own standalone apps.
  • Visual Building Tools: Drag-and-drop technologies for fast and easy app building & customizations. Use the Lightning App Builder to customize the Lightning Experience and Salesforce1 Mobile app. Use the Community Builder to customize template-based communities.
  • Lightning Exchange: A section of the AppExchange where you can find 70+ partner components to jumpstart your development.
  • Lightning Design System: Style guides and modern enterprise UX best practices to build pixel perfect apps that match the look and feel of the Lightning Experience and Salesforce1 Mobile app.

Q16 : What is the difference between Visualforce Components and Lightning Components?

A : Visualforce provides the facility for delivering template-driven web pages and email messages. In addition, developers wishing to simply utilize a basic container and maintain more control over the lifecycle of the request may choose Visualforce pages. Finally, organizations that can’t use Apex code can’t use Lightning Components, but they can use Visualforce.

Q17 : What are Lightning Extensions?

A : They’re a mechanism for using custom-built components to replace existing components in the Salesforce1 Mobile App. This functionality is currently in Pilot.

Q18 : Can we Include One Lightning component to another?

A : Yes we can include one Lightning component inside another Lightning component

Q19 : Where Lightning components can be displayed?
A :

  • In Lightning App (.app URL)
  • In Salesforce1 app as a Tab
  • As a lightning extension

Q20 : Do we need a namespace to develop Lightning Components?
A : You can have a namespace in your org but it is not necessary to have a namespace to develop the lightning component.

Learn SalesForce to Unleash a Modern Career

Join SalesForce Training

Q21 : What is Aura?
A : Aura is the open-source technology that powers Lightning Components. The aura: namespace contains all of the basic building blocks for defining components and applications.

 Q22 : Is Lightning Components replacing Visualforce?
A : No Lightning component is not replacing Visualforce, Visualforce is still supported by Salesforce.

Q23 : What happens to my existing Visualforce Pages?

A : They’ll continue to be supported in the current UI and Lightning Experience.

Q24 : Currently, can you show the Lightning components tab in Mobile as well on the desktop?
A : Currently you can only use Lightning Components in the Salesforce1 Mobile App or a standalone app.

Q25 : What is the use of the aura: method tag in Lightning?
A : aura:method is used to communicate down the containment hierarchy i.e. parent to child

Q26 : Which parts of Lightning Components are server-side and which are client-side?
A : Lightning components have two types of controller, one which uses javascript and responds to the event occurring in the components at the client-side and the second controller which is an apex class. The method of the apex controller is accessed by the JavaScript controller methods asynchronously.

Q27 : How Can We Deploy Components To Production Org?
A : we can deploy components by using managed packages, Force.com IDE, Force.com Migration Tool, or Change Sets.

Q28 : Can We Integrate Lightning Components With Another Framework, Such As Angular?
A : Yes. we can include the working 3rd party code inside a Visualforce Page, embed the Visualforce Page inside a Lightning Component. This Lightning Component can be used as any other Lightning Component in various environments.

Q29 : What are the type of events in the Salesforce Lightning component?

A :

  • Application Event – The scope of this event is throughout the lightning App and any component which has registered for this event would get a notification.
  • Component Event– Scope of this event is within itself or the parent component of this event, all the components declared within the parent component would get notified of this event.
  • System Event- these are the events fired by Salesforce’s system during the lifecycle of the lightning app.

Q30 : Where we can display Lightning Component?
A : There are a number of possibilities for display lightning component:
Lightning Experience: We can display component in the Lightning Experience using the App Builder.we can edit the home page, edit a record detail page, or create/edit a new app page to include it.
Salesforce1 Mobile app: We can display components in the Salesforce1 Mobile app by creating a custom Lightning tab that references it and adding that tab in mobile navigation.
Template-based community: we can display components in template-based (e.g. Napili) community using the Community Builder.
Standalone Lightning app: By create a standalone Lightning app (e.g. myapp.app) and include components in this app. Access the Lightning app by URL.

Learn SalesForce to Unleash a Modern Career

Join SalesForce Training

Q31 : Which interface we are supposed to implement so that a lightning component can be used as quick action?
A : We need to implement the following “force: lightningquick action” so that we can use the component as a Quick Action.

Q32 : What is the basic difference between the Application Event and Component Event?

A : Component events are used to do communication between child and parent. They use bubbling and capture the same as used in DOM events. A change in a child component can be communicated to the parent component via the component event.
Application events are used to communicate any change in the component to a broader audience. Any component who has registered for this event will get notified.

Q33 : How can we use a lightning component in a VisaulForce Page? Explain?
A : A Lightning component can be embedded in any webpage using a very powerful and flexible feature, Lighting out. When used with Visualforce some complexity becomes simpler.
The lightning component can be added to the Visualforce page in three steps:
1. We have to first Add the Lightning Components for Visualforce JavaScript library to your targetted Visualforce page using the tag.
2. Next, we have to create and refer a Lightning app that is used to the component dependencies.
3. Lastly, we need to write a JavaScript function which will finally create the component on the page using $Lightning.createComponent()

Q34 : What is the use of Document and Renderer in the lightning component?
A :

  1. Document: – A description, sample code, and one or multiple references to example components
  2. Client-side renderer to override default rendering for a component.

Q35 : How can we navigate from one component to another component?
A : Yes. With the help of lightning:navigate tag and then use the page reference in JS Controller.