It adds the server-side controller action to the queue of actions to be executed. Rather than sending a separate request for each individual action, the framework processes the event chain and batches the actions in the queue into one request. The actions are asynchronous and have callbacks.
To make a component extendable we need to set value of â€˜extensibleâ€™ attribute as â€˜trueâ€™ of the aura:component tag.
When a component extends another component it inherits all of the helper methods and attributes
aura:registerevent is the notifier component and it declares that it may fire a particular event, it includes â€˜nameâ€™ attribute which is relevant only to component event and is not used for application event. Other attribute is the â€˜typeâ€™ which lets the component know which event would be fired.
Ex. <aura:registerEvent name=â€Eventâ€ type=â€c:EventNameâ€/>
For subscribing to any event in the Lightning component, tags have to be included in the containment hierarchy. Subscription of this event is dependent on the type of event, i.e. component event or application event.
Spinners are the CSS indicators which we should display while retrieving the data or performing slow calculations. Lightning: spinner shows the animated spinner image for indicating that a request is loading.
In the APEX controller, we must enforce the CRUD and FLS manually. Also, while using Lightning data service, it takes care of CRUD and FLS.
Yes, we can integrate the lightning components with other frameworks.
Lightning Experience refers to the new User Interface, which is developed by the Salesforce team and is built on a component-based framework and architecture driven by events that provide a highly dynamic and responsive experience to the user. This framework is designed to give optimum performance by the Client side and the stateless Server architecture.
By using â€œValueProvideâ€, we can access the value from the attribute.
We can assign the lightning pages at three distinct levels:
1. Org default
2. App default: This assignment revokes the assignment done at the org level.
3. App, profile, record type: This assignment revokes the assignment done at App and org level.
Visualforce page is created keeping page as the center of the application and most of its calculation is performed at the server side. Lightning component on the other hand are created using the component based framework, most of the calculations are performed at the client side and makes the more dynamic and provide rich customer experience, also lightning component are build using mobile first approach.
Lightning App Builder â€“ It is a tool with User interface to use drag and drop functionality and create app fast by reusing the components, components can be standard or custom depending upon your requirement.
Lightning Component Framework- it provides a bundle that can be used to build reusable custom components, Standalone App and to customize Salesforce1 App
Lightning Connect â€“ it is a powerful tool to facilitate the integration of force.com app with an external data source using OData specification
Lightning Process Builder â€“ it is a visualization tool to build automation required for your business processes.
Lightning Schema Builder â€“ it is a visualizing tool to view, create objects fields and relationship among them.
To define the field level security, we should use Lightning:recordEditForm, force: record data, and Lightning: record form.
1. Capture phase: This phase propagates from top to bottom
2. Bubble phase: This phase propagates from bottom to top.
The Lightning: action override allows us to use the component like an override for the standard action. We Override the New, Edit, Tab, and View the standard actions over the traditional and standard components. Components must implement the Lightning: action override interface that the component emerges in the lightning component bundle menu.
In the salesforce mobile app or the lightning component, we can use the force:appHostable interface as a custom tab.
1. If we have to import a function, class, and variable defined in the module, we have to use the import statement.
3. lwc is the core module of the lightning web components. â€œImportâ€ statement imports the LightningElement from the lwc module.
The meta configuration file specifies the metadata values to the components. If we do not have a configuration file for our component, we will get an error when we push our changes.
Scratch org is an expandable salesforce org that we use for testing and development. We can create the scratch org for 30 days after which we deactivate the Scratch org. Scratch org default duration is seven days.
Action provider allows us to manage the events, actions, and handlers for the component.
In the lightning:recordEditForm, we use the lightning:inputField for creating the editable fields. By using the lightning: output field, we can display the read-only information. lightning:recordEditForm contains the below features:
It displays the record edit layout to edit a particular record.
It displays the record to create the layout to create a particular record.
<ui:input> does not contain lightning design system styling while <lightning:input> contains lightning design system styling.
We use Namespace for grouping the components together. The lightning components that we use are a part of a Namespace. C is the default namespace, and we can create our namespace through our organization. If we create the namespace for our organization, then we can use that namespace for our lightning components.
We use lightning app builder for creating the lightning pages for the mobile applications and salesforce lightning experience. A lightning app builder is a click-and-point tool, and we build the lightning pages through the lightning components, which are configurable, reusable, and compact. Through lightning app builder, we can build different types of pages:
1. Home page
2. App Page
3. Record Page
The lightning:isUrlAddressable interface is used when navigating to the component and also when the component to be navigated implements this interface.
We can arrange component by using managed packages, Force.com Migration Tool or Change Sets, Force.com IDE.
It is applied for enhanced security purposes. This security architecture safeguards Lightning components by isolating them in their specific namespace. The Locker Service is useful when building components, it also permits access to only supported APIs.
Yes, it is possible to integrate Lightning with other frameworks, for instance with Angular. You can also apply a third-party framework to Aura components. Nevertheless, you canâ€™t use a third-party framework right within Lightning Web Components.
Lightning Data Services (or LDS) are needed for caching purposes. This framework allows you to upload, add, modify or delete a componentâ€™s records without the need of Apex code from the server-side. It is also applicable for Sharing Rules and Field-level Security, not to mention its benefits for enhanced performance and the opportunity it gives the users to work with data offline.
Also shortened to SLDS, the Salesforce Lightning Design System is a CSS framework that gathers the top design practices and style guides to assist in creating appealing Lightning applications without the need to write CSS code. As such, SLDS provides numerous default solutions on fonts, colors, palettes, etc.
There are several different ways we can approach component debugging, the fastest and most simple is to simply provide console logging statements to log variables throughout code execution, however this is an extremely limited approach and there are far better ways to debug our components. The first step is to enable â€œLightning Debug Modeâ€ to remove minification and provide better error messages. Alongside this, we can use our browsers debugging tools to provide breakpoints to examine the precise execution of code within our components, review variables at run time, and step through our code to better understand whatâ€™s going on and find whatâ€™s going wrong.
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.
Any component can dismiss and handle the application events. Application events do not need any type of relationship among the components, and these components should be a part of one application.
In the following places, we can use lightning components:
1. Drag-and-drop components in the community builder and lightning app builder.
2. Add lightning components to the lightning pages.
3. Start the lightning component like a quick action.
4. Create stand-alone applications.
Components events are the events that child components dismiss, and parent components handle. We use component events when we want to send a value from the child component to the parent component.
We use implements for referring to the platform interfaces that allow us to use the components in various contexts, or grant access to additional context data, and by using implements, a component can implement multiple interfaces.
Locker service is a robust security architecture for the lightning components. The locker service improves security by isolating the lightning components which belong to the namespace from the components in the distinct namespace. Locker service supports the practices which enhance the maintainability of our code by enabling access to the supported APIs.
FlexiPage portrays the metadata related to a lightning page. The lightning page portrays an adaptive screen composed of regions comprising the lightning components. The lightning page contains 25 components. We store the Flexi page as an XML file, and we deploy it through a deployment tool or metadata API. We refer to the lightning pages as Flexipages in the API.
We use unbound and bound expressions for performing the data binding. When we call a child component from the parent component, we can send the value to a child component attribute from the attribute of a parent component.
We can create it with the following steps:
Setup->App Builder in Quick Find Box->Select Lightning App Builder-> New->Record Page-> Name the page as <xxx>Select Opportunity->Choose Header, Sub header, Right Sidebar template and Click Finish.
Please go through the link for further details on creating a custom Lightning Page.
The Lightning Out feature is applicable in cases when a component that youâ€™ve made needs to be used on an external site outside Salesforce containers as well as on any webpage.
We can Use <aura: method> to describe a technique as part of a componentâ€™s API. This enables us to straight call a process in a componentâ€™s client-side manager instead of firing and management a constituent event. Using simplifies the code desirable for a father component to call a technique on a child component that it contains.
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.
Add, remove, or you can even reorder components on a record page for a custom view of objectâ€™s records with the help of Lightning App Builder.
Yes, it is also possible to customize a record page and assign it to the Lightning apps. The users can access a custom record page for the context of the app they are working on.
Created using the Lightning App Builder, there are three following record page types in Lightning:
1. Home Page (needed for crafting home pages thatâ€™ll display only necessary features to indicated user types in the Lightning Experience);
2. Record Page (used for making a unique record page of an object based on the necessities of users; available in mobile apps and in Lightning Experience);
3. App Page (applicable in Lightning Experience and in mobile apps, itâ€™s handy when making an app homepage in 3rd-party apps and menus for navigation, such pages can only have global actions).
Actually, no, there is no limit regarding how many components are allowed in an application.
Not really, however, the component bundle can be created first.
It is possible to insert the third-party code within a Visualforce page. The same Visualforce page is then put inside a Lightning component. Then the same Lightning Component is used in another Lightning component that works for various environments.
The main benefits to using the UI API are the same as using the LDS, we get cached data for improved performance and ease of data management, ensuring all our components are displaying the correct data. Alongside these, there is the added benefit of reducing the amount of Apex code written, e.g. we no longer need to write controller methods for simple record updates.