Script 4
Script 4
Script 4
used, Its Use Cases, Its Advantages, Aura Component Bundle, and we will be looking into its
implementation with the Example of simple Use Case. So let me share my screen.
Slide 1- Introduction
There in we used Aura Components to customize our solution that fit their Requirements
- Aura Component is a powerful open source framework for building dynamic and interactive user
interfaces.
- Aura Components enable developers to create reusable units of functionality that improve the
performance, and maintainability of their applications."
- They encapsulate HTML, JavaScript, and CSS into self-contained units that interact with Salesforce
data and can be reused across applications."
- Basically We design our Application in such a way that each component performs a small unit of
work independently so multiple components Weave together to create an application.
- They have responsive Design, Since they are Built in with mobile first approach and are compatiable
with wide range of browsers.
Slide 3 –
Aura Components in Salesforce help us make dynamic and interactive web applications that work
well both on computers and mobile devices. Even though Salesforce has introduced a newer way of
building applications with Lightning Web Components, Aura Components are still important for some
projects.
- One of its Major use case is that it allows users to create Custom User Interfaces which are
reusable components and can be reused across different Parts of Application
Now I will move to developer Console to show how the component is created and what it provides.
Move to dev console and show the component.
For creating a new lightning component just go to new and click on lightning component here you
can name your component according to your functionality.
Bundle basically is a set of resources which we can use to write our code in order to modify the
behaviour of our component.
- So the first we have "Component File .cmp" inside which we write User Interface/What are the
things our component will display.
- Then we have two types of JS File One is controller and other is Helper.
- Controller is the first point of interaction in your lightning Component andd the user. We specify the
methods here that will be called when your user interacts with LC.
- Basically a JS Helper contains small peices of reusable code that we can use inside our Controller.
- Then the Lightning Framework allows you to use our own Stylesheets so we can just put our
customized style inside this css files.
- First of all let's Understand the Use Case which I will be covering.
- So I have created an Aura Component that is Used to search the Exisitng Cases in Our Org. Here it
contains a search box.
- Controller - It specifies that the component uses a server-side Apex controller named
customSearchCaseController. This is used to fetch the records from our org.
- Aura Handler - Sets up an event handler for the component's initialization event (init). When the
component is initialized, the doInit function from the component's controller (c) will be called.
- Includes a Lightning input field of type text, allowing users to enter a case number. It has a label, an
aura:id (which helps to identify the element programmatically), and an onchange event handler that
calls the searchKeyChange function in the component's controller when the value changes.
- Aura If - Starts a conditional rendering block that will only render its contents if isRecord is true.
- Includes a lightning:datatable component which is a data table used to display rows of the cases
data. It specifies Id as the unique key field for the rows, binds the cases attribute to the data of the
table, and the tableColumns attribute to the columns configuration. The hideCheckboxColumn
attribute set to true indicates that the checkbox column used for row selection should be hidden.
In my Method
- Action - Defines a callback function to handle the response from the server-side method call.
- SetParams - Sets the parameter for the findByName method call, passing the search key obtained
from the input field.
Once the Cases are returned from the Apex Method we move further.
If the setCallback method returns SUCCESS then we move further, in case any error comes in Apex
Method we can handle it using toast method which is considered as best practice.
-Value – We are setting whatever we are getting from our apex method.
- Iterates over each returned record to enhance the data, by creating a URL path using the record's
ID.
- Enqueues the action for sending to the server, which will execute the Apex method and
handle the
- response using the defined callback function.
So that’s it for the session, if you have any questions you can ask. Thankyou.