 Hello everyone. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this module, I'm going to demonstrate how we can implement system and browser events in lightning or a component. So let's understand how we can implement system event and browser event. So first I'm going to demonstrate system event implementation. So I'm going to create new lightning component. I'm naming it as ACC data, and I'm enabling this checkbox because in future I want to place this lightning component on the record page. So lightning component is created and it is having these two interfaces implemented automatically. So here we have available for record home and force has record ID, right? So I'm just saving this. Now I just need to link this lightning component with the Apex controller. So I'm going to create that as well. So I'm creating Apex class as ACC controller. Now in this ACC controller, I'm going to implement the code. So with the help of Adlerate Aura annotation. So I'm going to use this code. So here you can see Adlerate Aura enabled annotation is available. And this get accounts method will return these queried account records. So five account records will be queried along with ID name and phone. So I'm just removing phone from here because I will be using ID and name only. And those records will be available in this ACC list and it is being returned. So I'm just saving this file. Now jumping to my component, right in this component, I'm going to use my system event. So first of all, I'm going to create one attribute. Naming it as ACC list, right? Now after this, I'm going to implement a handler, right? So its name is in it. So in it is basically a system event. So you just need to handle it. It is fired automatically whenever your component loads in the browser. So we just need to handle and we need to define like what operation we want to perform when this event is fired. So value equals to this and action equals to. So now you need to understand. So name is in it. So it will be handled automatically. Value equals to this. So it says like the handler is available in this component only. And with this, with the help of this method, your operation will be executed. And do in it. So this is a name you can use any name for defining the function. And the C dot you need to use because this method will be defined in the controller part. So this way we can handle system event. Now I'm using a tag lightning select, providing it name as select one and its label will be select an account. Right inside this lightning select, I'm going to provide options. So option value equals to null and none will be displayed. So when we create a pick list or drop down using this lightning select tag, so this none will be displayed on the UI and if you select this none. So this value will be processed in the backend. Now after this, I just need to use or iteration so that I can iterate over this ACC list where account list will be available. So or iteration then items equals to the dot ACC list. And we need to use a variable where one by one accounts will be available from this list to this item variable. And here I'm going to use option value equals to item dot ID. So we actually queried ID and name. So if you focus on this SQL we queried ID and name. So those ID and name we are going to use here. So I'm just closing it and here I'm going to use item dot name. So what will happen. Name will be displayed on the UI and if you select a particular account name. So for processing purpose that ID will be used to this value attribute. So basically the UI part is implemented. Now we need to go to the controller and we need to define the doing it method. So here you can see we are just mapping this init handler with this doing it method. So in the controller you will be defining your doing it method so that whatever operation you want to perform, you can write. So I'm just creating a variable named as action. So component dot get then see dot get accounts. So this is basically the function that is available here. Right. And one more thing we need to do we need to use this here. So I'm writing controller equals to wherever you want to link your apex class with your lightning component so you need to use this statement as well. Right. So we just call the method that is defined in the apex controller. Now action dot set callback. This then function response and here you need to apply this database and variable state equals to response dot get state. A triple equals to success. Then you can write component dot set V dot ACC list and then response dot get return value. It is closed here then you can use dollar a dot action and here you can pass the action. Right. So this way I defined this method. So this method is basically linked with this order handler. So this way I hope you understood like how.