 Hello. Hi everyone. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So I hope everybody is doing good. Those who have joined life or if you are watching the recording. So I hope you are doing good. And today we are going to have day 77 of Salesforce Learning Bootcamp. And the topic will be lightning on a component. So today I will give you little bit insight how we can connect our lightning on a component with Apex. Okay. And I will share information related to all the recorded videos. Those are already available on my channel. So with these three sessions, you have got the basic idea like how lightning components are implemented. So basis on this learning. Now if you watch the pre-recorded video, so I'm sure you will be able to understand all the concepts properly. Right. So we'll share that information with you soon. So starting my session. So if you have joined this session for the first time or you're watching this video on this channel for the first time. So if you need to know like who am I and what I have done. So this slide will show you everything about me. So just go through with this slide and I in every session I say like consistency is the key. So please do regular practice and with practice you will be able to understand all the concepts. And if you want to become part of Sanjay Gupta Tech School community, so just scan this QR code and more than 2,500 folks are connected with this group. And if you have any kind of doubt, so you can ask your questions there. So today we'll be completing week 22, which is based on lightning or a component development. And from next week onwards, we'll be starting lightning web component sessions. So just share Sanjay Gupta, sorry, just follow Sanjay Gupta Tech School on YouTube, LinkedIn, Instagram and Telegram. And all the links are available in the description. And please share a review or feedback about the bootcamp. I see lots of people are sharing their feedbacks on YouTube and lots of people are sharing on LinkedIn as well. So please keep on sharing your reviews or feedback so that I can have some motivation from your site. Okay. So before explaining Apex controller in Aura component, I just want to take you to this session tracker. So I hope everybody is having access to this session tracker. And here in this session tracker, you will find this playlist link. So we have two things interview Q&A and this playlist link. So if you click on this playlist link and if you open it, so you will find lots of recorded videos. So many things like all the beginning things I already demoed you like till session nine, which are recorded. So these are 10, 10, 15, 10, 15 minutes videos. So if you want to understand a few more things, so you can just go through with this playlist. So it is not possible to cover all the sessions otherwise bootcamp will be so long. So now what you can do the remaining sessions you will be covering with the help of these recorded videos. So link is available in the session tracker. And if you want to go through the question and answer, so that is also available. Okay. And from next week onwards, we'll be starting lightning web component. So lightning web component development requires a prerequisite. So the prerequisite is you just need to install VS code and you need to set up that. So for that, what you can do just go to study salesforce.com and under developer section, you will find lightning web component. If you click on lightning web component, so here you just need to watch and you need to follow this video number two, which will tell you how to set up VS code for your VS code in your system for Salesforce so that you can build lightning web component. So I'm just copying this link and sharing it in the chat as well so that you can have it handy. Right. And let me just insert it here as well. Right. So this, this is basically a prerequisite for you. So everybody, please go through this video if you have not installed VS code as of now in your system. So I am expecting like you can do this at your own. So this is important. And if you have this in your system, so it will be helpful. Okay. It will save our time. Right. So I hope you got enough insight about next week. So let me just highlight it with different colors so that it will be visible to everybody. Okay. So yep. So let's begin with this topic. So I'm going to show you how we can connect our aura component with apex. And if you have any doubt, so you can ask me and it is very easy. And we need to understand like how we can connect our lightning component with apex controller. So basically, in the first session, I showed you a diagram like your aura component will be loaded on the client machine and apex controller will reside on the server. And through that apex controller, any kind of S object value you can retrieve on your in your aura component and you can show it on the UI. Okay. So now I'm going to show you how we can implement it. So first of all, I'm going to create a new apex class and naming it as account controller. Right. So this account controller is the class and if you want to access any method from here, so this way you can define it. So our method name is get accounts and its return type is list of account. So if we call this method, so it will be returning a list of account records. And if you want to call it in aura component, so you just need to use it. This annotation that is aura enabled. So if you use aura enabled annotation, so this method now you can call in aura component. So this is same for aura and LWC. So in our component or in lightning web component, if you want to call any method that is return in apex class, so you just need to use this aura enabled annotation. Now here I'm going to create list of account. Right. Then I'm going to receive account records. So you can do it with single line as well. So first I'm going to implement it in simple way and then you can write return ACC list. Okay. So right now here we have three statements. You can you can write it in single statement as well. Right. So what you can do, you can simply write return and then you can have this SOQL. This is also possible. Right. So if you want to create a variable for this list, so that is also possible. Otherwise you can write this single statement also. So with this statement, whatever account records you will be querying, they will be returning to the component where you will be calling this method. Okay. So now I'm going to save this and I'm going to implement a new lightning component. So here naming it as account data. And if you want to place this component on any anywhere so you can enable these checkboxes as per your requirement. So just click on submit so that component will be created. Right. So here here we actually need to implement the statement. Yeah. Yeah, Jenna. This is right for LWC as well. We have to use aura enabled annotation. So it is same for both. Okay. So this way, like now I'm going to implement the code. So here first of all, you need to write controller and then here I'm writing account controller. So this way your apex class is basically connected with your component. Okay. Now what you can do, you can write attribute name equals to ACC list and type equals to list. So I hope everybody knows about attribute attributes are variable that we create an aura component name is ACC list and type is list. Right. ACC list can contain multiple values of similar type. Now here I'm going to implement one more thing that is aura handler. So I'm going to explain it in detail because this I'm using for the first time. So first of all, let me implement this. Then I will be explaining you what it is. Okay. So basically whenever we perform any event and if you want to handle that event. So for that handling, we need to write aura handler. So basically whenever your component loads whenever your component loads on any web browser. So basically an event event is a trigger right automatically on load. So if you want to handle that in it event in it initialization and you want to perform any action automatically on the load of component. So for that we are writing this statement. So you can simply understand on load of component. If you want to execute any method so that you can execute with the help of this aura handler. So aura handler name is in it in it means initialization. Value equals to this means the code which we want to execute is available in this component only and action means like which method you want to call. So method name is do in it. Here we are using C dot. So it means this method will be defined in the controller of this component. And in yesterday's session I told you how we can implement a controller. So in if you click on this controller. So here I will be defining this do in it. Okay. So before implementing this do in it, let me complete this code here and then I will show you the definition of doing it. So here I'm going to use lightning select. So what I'm going to do with the help of drop down with the help of a pick list. I will be showing all the account records that we are fetching from here. So we are fetching 10 account records. So those 10 account records will be available in a pick list. So for that we are using lightning select. And yesterday I showed you lightning component library. So here under aura, like if you simply select here, if you simply search here, like select. So here you will find lightning select under aura. So if you click on it. So here you can see you will be able to create this kind of drop down. Okay. So lightning select then this code you need to implement. So that we are doing right now here. So lightning select name equals to select one name can be anything. Then you need to provide the label. So label I am providing as select an account. Then here you need to provide options. So option value equals to null. And then here like first option first value of that pick list will be none. So as a label none will be displayed. If you select none, so its value will be null, right? So we need to have two things. One is the label that will be available on the UI. And if you select that label, so what what value will be used for processing purpose that you need to define with this value attribute. Now in this code, you will understand how we can write a loop in aura component. For that you will be using aura iteration. Then item items equals to and then here you need to write V dot a CC list and then variable equals to item. Okay. So this is basically a for each loop. This is similar to for each which we are writing with aura iteration items is having all the content which is available in this list and one by one. Each item from this list will go into this item variable. So this item is the name of this variable. This can be anything. But here you need to write where as a attribute right items and where are fixed a CC list. This name can be anything and item this name can be anything. So right now what is happening one by one account one by one account record will be available into this item variable. And now inside this loop I am going to write option. So this this loop will repeat 10 times because we are receiving 10 records from our S object. Okay. So value I am setting here as item dot ID and here I need to show the label so that I am showing as item dot name. So what is happening from this account list one account record is available in this item. So through that item if you write item dot ID so it means that particular account which is available in this item variable that accounts ID you are assigning into this will value. And then if you want to show the name of that account record on the UI so you are using this item dot name in between of this option. So similarly above we wrote none none will be available on the UI and if you select none so this null will be used for processing purpose. But from here if you select particular account so that particular accounts ID will be used for processing purpose. Okay. So this way we implemented this code where with the help of lightning select we implemented a pick list. And with the help of this pick list all the account records will be rendered on the UI. Now next step is to implement do init method right because with the help of doing it only will be able to have the data. Right. So what I am going to do now I am going to write controller method for you. Okay. And this this is a lightning select which will be having the data through ACC list. So basically what we need to do we need to fill this ACC list because whenever you will be rendering this component on the UI. So we want this pick list should be having some values and that will be coming automatically because of this do init. So this do init method or function will be executed whenever your component is loaded on the UI. So here I am going to write some code which we will be like which which will be executed whenever your component will be loaded. Okay. So what I wrote here this is simple component dot get and here I am writing C dot get accounts. So basically this get accounts is a method is a function that we wrote here. Right. In our Apex class we have a function or method name named as get accounts. So that we are calling here with the help of the syntax. So this is a syntax you always need to write it like this and make sure JavaScript is case sensitive. Right. So whatever case you have used here as is you need to write here otherwise it will break. Okay. Now here we are creating a callback function. So the result of this will be available into this action. So through that action we are just creating a callback. So here I'm writing variable variable state equals to response dot get state if state triple equals to is success. So what we need to do we need to set V dot acc list right and response dot get return value. Okay. And here you can end it. So this is a complete block. So generally whenever you need to call any method that is available in Apex. So you will be like you will be writing line number three and whatever variable you are using here. Here you it is not necessary. Like you will be using name as action every time it can be any name. Okay. So through that variable name you just need to use this set callback method and here this means current component and this function response. So whatever response we'll be getting from this method it will be available in this response variable. So we are actually processing it here. So response dot get state will be assigned into this state variable. So this is a method it will be returning the state if it is success it means we received some data from that method. So that returned value we are getting through this method and we are storing it into acc list this acc list we created here. And this whole functionality will be executed through do in it and do in it is calling whenever your component is loading. So whenever your component loads so this this do in it method will be executed. So first of all this doing it will be executed so that acc list will be filled and with the help of this acc list this pick list will be having some values. So you don't need to do anything you just need to save this code and you need to run the code with the help of application and whenever component will be rendering on the UI so you will be having some data. So I'm just saving this code and I'm going to open our demo app that we created. So here I'm going to call this account data. Right. Click on preview. So you will be having the results here. So here you can see we have a pick list and okay it is right now not having any data. So it is just showing none. There is no data so we just need to check the code. So there might be some issues. So you guys if you if you have gone through any any video or any concept related to this so just try because this is the problem with aura or lightning web component like if you encounter any issue. So you just need to recheck your code properly at the time of implementation you don't see any error. So let me just check what is the issue. Okay. I think I just missed one statement. So after this line basically I just need to write one more statement. So basically with this set callback we are just creating this piece of code and we just need to enqueue this action. Right. So with this action if you write set callback so basically you are creating a bundle of statements that you want to execute. So what you need to do you need to write one more statement dollar a dot enqueue action and here you need to pass this action. Right. So this this whole action will be enqueued in the queue and whenever resources are available so then it will be executed automatically. Right. So this is basically part of syntax that you need to write and once this code is implemented then at the end you will be writing it. Right. So now I am moving here and refreshing the page one more time and I hope it will be executed this time. Yes. So here you can see we have total 10 account records data and here what we are having we are having we are having these options like account name as a label. And if you click on any account so it is right now selected and in the back end the selected accounts ID you can use for processing purpose. Okay. So this way like we fetch the data from apex and we we can show that with the help of this component that is a pick list. So I just gave you a little bit inside now like this this week or weekend whenever you get time. You can just go through with this playlist and you will be having enough information about or a component. Right. And from next week onwards we'll be implementing lightning web components. So we'll learn that. So Rajeev is asking we didn't use cacheable true here. So basically we use that for lightning web component generally. Yes. Mohan this is because of like less demand. So but but don't worry. Learn learn your skills. Don't don't push back yourself because you don't know whenever there will be lots of demand because this this is a up and down. So last two two years there were lots of demand in the market this year unfortunately there is less demand. Right. So soon soon this graph will grow as well. And when this graph will grow. So if you have proper skill set then only you will be able to survive. Okay. So I am trying my best to give you enough knowledge this year so that you will be ready whenever there will be an opportunity. And we are just halfway. There is lot to learn right now like after this lightning web component development sessions. There is there is a lot of things you need to learn. There are lots of clouds QA process be a process that you need to understand. So still we have lot to learn. So if you have all those knowledge so then you need to prepare your CV in such a way like you know lots of things. You know different different roles and then if you appear for interview. So being a fresher or experienced folk you can just say like I have knowledge about all those roles. So you will be stand out differently in those interviews. Right. Okay. So Jana is asking what is the use of NQ action at that. So basically Jana whenever we create this set callback method. So whatever statement you write here. So these statements are not executed automatically. So what you need to do the variable which you are using to set the callback method that variable you need to pass in this NQ action. Once you pass that variable into this NQ action then only that particular block of code will be executed. So if you if you remember like when I didn't write this so this piece of code didn't execute because I didn't pass this variable in this NQ action method. So this is important. So Lingoraja this Raju this is not possible like if if you forgot to check those checkboxes so there is one solution. What you need to do you just need to write those interfaces manually here. So you can search those interfaces on internet and you can just copy paste those interfaces directly. So that is hardly an issue. So I'm going to share this link with you so that you can go through with remaining of the videos those who want to. Otherwise from next week onwards we'll be starting lightning web component development. So we'll be giving you introduction next week Monday and then we'll do some hands-on. So for this also I just created one playlist. So if you watch that playlist first and then attend the session so you will be able to ask questions frequently. Right. So three weeks I decided so I think in three weeks I will be able to give you enough insight about that and then we'll be learning about deployment and then QA. Right. So there is a lot to learn and don't lose hope if you if you are learning so that that won't be going way as a waste. So whenever there will be an opportunity and if you have your skillset ready so you will be surely given a preference. Okay. So with this note I just end today's session here only it was short. So just just to practice whatever I can do for you. So the motto of this bootcamp was to have a proper schedule for you. So we completed almost six months. So now I think for most of you those who are following this bootcamp you have a proper schedule like every week you need to learn something. You need to practice something. Right. So this was the basic objective and I tried to explain the concepts trying to answer your questions. Right. So do regular practice. No Shivani. It is not true like if you are using or iteration then you are using an action. So basically what is happening. If you are using this set callback if you are using this set callback then only you just need to use this. So basically if you are interacting with your apex code with aura component then we need this particular code. Yes. We'll be doing sessions on business analyst skillset as well. But that will be after QA Q quality analyst sessions. So Vladimir O apex project link. I think it is available in the sheet if you go above. So here here you will find the project document link. Still I can share that for you. So here you will find all the admin project recorded videos and development related things you will find here. So I think on Sanjay Gupta Tech School YouTube channel you have everything now. You have admin related sessions. You have flow related sessions. You have all the apex related session apex trigger test classes as in Cronus apex. You have integration related sessions. You have admin project. You have development project. You have lightning web component along with HTML CSS JavaScript basic and soon you will be having lightning web component sessions. Then deployment related session QA BA and then I will be focusing on the only studio and then we'll be picking cloud specific sessions. Yes. So that we can discuss later on. So maybe once lots of things will be covered. So maybe so I'm what I'm planning to do. I'm planning to start some podcast kind of thing where I will be inviting experts from industry. Those who are working on different roles. So they will be coming live on the channel and like as per your interest in which role you have interest or whenever that session or podcast will be there. So you can ask questions live. So I'm planning that soon. But right now like I'm focusing on to complete this bootcamp and maybe in a month or so you will hear soon. Like I will be having live podcast with industry expert those who are working on different roles. So I'm planning to cover admin QA BA dev tech lead dev lead solution architect technical architect project manager DevOps engineer. Right. All these roles I'm planning to cover. So I will be having different different industry experts and they will be available here for 30 to 45 minutes. And whatever question you will be having you can shoot and they will be answering your questions along with me. Yes. Mohit velocity is booming a lot. That's why I'm planning to have session on Omni studio. So I'm just waiting to end all these whatever I have planned. Otherwise it will be a lot for people. So I don't want to do a mess. So I'm going systematically. So maybe after one month or so there will be sessions related to bootcamp. Sorry Omni studio and Omni studio is very much important if we talk about velocity and surely on mule soft as well. Right. So by the end of this year lots of things will be available on this channel. You don't need to go anywhere and everything will be available in this session tracker. Right. So I will keep track everything in a sequence so that you will be having everything in place and in proper sequence. Okay. So Mohan or is mandatory. No or is not mandatory. I just gave you a little bit insight like how we implement or a component but lightning web components are mandatory. Okay. So this is it for today. We'll connect on Monday now with new things that is lightning web component. Yes. Mohan that will be done. That will also be done. More interviews will also be done. Right. So have some patience. Let me finish lightning web component because after that I won't be taking the session. So I will be preparing something for you and my colleagues like they will be doing sessions on deployment QA skill be a skill because I have never worked on as DevOps engineer QA engineer or business analyst. So I'm picking a few folks from industry and they will be delivering those sessions and in the meantime I will be preparing some more stuff for you. So surely we'll be doing mock interview related sessions as well. So let me let me just write things here. So what we'll be doing so I'm just copying and pasting this here so that you will be having enough insight. So business analyst will be there. Then we'll be having only studio. You can just remember it with velocity. Okay. Before that maybe we can do mock interview sessions for freshers and experience force. Right. So this this I am planning to do in future. Okay. And mule soft also I will search someone if I found. And yeah so this this is like forecast. So we'll be having LWC deployment related session QA related sessions be a related sessions mock interviews only studio and mock interview I will be doing in two ways. We'll be focusing on your soft skills and will be focusing on technical skills. So I will invite someone who is good in soft skills. So they will be sharing you some insights like how to introduce yourself how to tell about your hobbies and blah blah blah. So other than technical whatever things you need to keep in mind. So I will invite someone who will be sharing those skills with you. Right. So this is the forecast that I will be doing. Okay. And still if you see like you need some something else. So let me know and we have a telegram group so you can just share your thoughts there. Okay. And parallely C and C++ bootcamp is also running. So those who are new to it industry from non technical background or you are a BTEC student. So you can join that bootcamp as well. Right. It is happening after this bootcamp. So it will be at 9 30 PM IST. Okay. So you can join that as well. So this is it for today. Thank you so much for joining today's session. See you on Monday. Same time. Thank you everybody. Bye. Take care. Yeah. So someone is saying AI. So I already planned and you will be having sessions on data plus AI. So I have someone who is expert in data as well as AI. So it will be there for you. So for data and AI there will be separate bootcamp. Okay. Okay. Take care. Bye. See you on Monday.