Salesforce lightning Interview Question and Answers
What is Salesforce Lightning?
- Lightning is the umbrella term for the collection of tools and technologies e.g. Lightning component framework, lightning experience, lightning app builder etc.
- Lightning became available in October 2015 with the release of Winter ‘16
What are Lightning components?
- Components are the self contained source and reusable units of an app.
- UI Framework - Built on Open Aura Framework.
- It is used for developing web apps - For mobile and desktop devices.
- It is a client server framework.
- It helps to accelerate the development.
- It helps to improve application peformance. It has stateful client and stateless server.
- It has several reusable out of the box components.
- A Component can contain other components, JS, HTML and CSS.
- Encapsulated, configured through attributes and communicate through events.
- LC are device aware and have cross browser compatibility.
What is Aura? What is the relation of Aura with Salesforce Lightning?
- It is a UI Framework for developing dynamic web apps for mobile and desktop devices.
- It is totally independent of Salesforce.
- It has several out of the box components like button,checkbox,datagrid etc.
- It is available at https://github.com/forcedotcom/aura
- The aura namespace contains components to simplify your app logic, and the ui namespace contains components for user interface elements like buttons and input fields.
- The Lightning Component framework is built on the open source Aura framework.
What is Lightning Experience
- Lightning Experience is the new, modern user experience and interface for using Salesforce.
- It has a modern and responsive design. It is optimized for users so that they can work very fast and easily on records so that they are more productive.
- Not every feature of Salesforce is supported in Lightning Experience yet. Because of this, Salesforce Classic – is still available, and users can switch between Lightning Experience and Salesforce Classic with ease.
- It is not necessary for the entire org to move to Lightning Experience at the same time. Certain users can enable Lightning Experience, while others can continue using Salesforce Classic.
- Admins can enable Lightning Experience access at the user, profile, and organization level.
What are Lightning Apps?
Lightning Apps are made of Lightning components.
- Lightning App is a special top-level component whose markup is in a .app resource.
- You can Access app using url of this pattern https://.lightning.force.com//.app
- Mark up starts with
- Types
o Standalone – can be hosted outside SF1 and LE, like lightning out and VF pages
o Lightning Experience and SF1 – Can take advantage of record create and edit pages, among other benefits
What is pre-requisite for learning Lightning component development?
- Learn JavaScript. You must have intermediate level of JavaScript knowledge.
- Learn concept of web components like google polymer, react,etc
- Learn Single page app concept.
- CSS3 Knowledge.
- JavaScript debugging.
- Apex knowledge for server side logic coding.
What is a Lightning Component Bundle? OR What is a Lightning component made up of?
A component bundle contains a component or an app and all its related resources.
- CSS Styles
- Controller
- Design
- Documentation
- Renderer
- Helper
- SVG File
What are the types of events in Lightning?
- Component events are handled by the
- component itself or
- a component that instantiates or contains the component.
- Application events are handled by
- all components that are listening to the event. These events are essentially a traditional publish-subscribe model.
What is @AuraEnabled annotation used for?
- The @AuraEnabled annotation enables client side access to an Apex controller method.
- Providing this annotation makes your methods available to your Lightning components.
- Only methods with this annotation are exposed.
What is Lightning Design System (SLDS)?
- The Salesforce Lightning Design System includes the resources to create user interfaces consistent with the Salesforce Lightning principles, design language, and best practices.
- It helps to create an intuitive UI with less number of clicks which is modern and beautiful.
What is the use of access=“global”?
- Mark your resources, such as a component, with access="global" to make the resource usable outside of your own org. For example, if you want a component to be usable in an installed package or by a Lightning App Builder user or a Community Builder user in another org.
What are Component Attributes?
- Component attributes are like member variables on a class in Apex.
- They 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.
- Use the tag to add an attribute to the component or app.
- All attributes have a name and a type.
- Attributes may be marked as required by specifying required="true", and may also specify a default value.
What is Lightning Data Services?
- It is data Layer for Lightning
- Can be equated to Standard Controllers in Visualforce
- Use Lightning Data Service to load, create, edit, or delete a record in your component without requiring Apex code.
- No SOQL required.
- Lightning Data Service handles sharing rules and field-level security automatically.
- Declarative CRUD operations
- Auto notify on record changes
- Offline Access for Salesforce1
- Lightning Data Service improves performance and user interface consistency.
What is Salesforce Lightning CLI?
- It is part of Salesforce DX CLI Command that lets you scan your code for general JavaScript coding issues and Lightning-specific issues.
- Useful for preparing your Lightning components code for LockerService enablement.
- Based on ESLint project.
Is Namespace required for lightning component creation?
- If you’re not creating managed packages for distribution then registering a namespace prefix isn’t required, but it’s a best practice for all but the smallest organisations.
What are Local and Global ids with respect to lightning component?
- A component has two types of IDs: a local ID and a global ID.
- You can retrieve a component using its local ID in your JavaScript code.
- A global ID can be useful to differentiate between multiple instances of a component or for debugging purposes.
- Local ID is created by using the aura:id attribute.
- example
- To find the local ID for a component in JavaScript, use cmp.getLocalId()
- Every component has a unique globalId, which is the generated runtime-unique ID of the component instance.
- A global ID is not guaranteed to be the same beyond the lifetime of a component, so it should never be relied on.
What is the requirement for a component to be used in a custom tab in lightning experience or Salesforce1?
- Add the force:appHostable interface to a Lightning component to allow it to be used as a custom tab in Lightning Experience or Salesforce1.
- Components that implement this interface can be used to create tabs in both Lightning Experience and Salesforce1.
What is FlexiPage?
- FlexiPage Represents the metadata associated with a Lightning page.
- A Lightning page represents a customizable screen made up of regions containing Lightning components.
0 Comments