 Hello everyone, I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So, today we have day 47 of the Salesforce Learning Bootcamp. And in today's session, we are going to discuss about Apex Trigger. So, we already covered four events. And three events are remaining, which are before delete, after delete and after undelete. So, in this session, I am going to cover these three events. And if you have any question related to that. So, after each scenario demo, you can ask those questions. So, I hope you are enjoying trigger related sessions because I am just focusing on lots of scenarios. So, a few, I am demoing in the session and I am keeping few for your practice. And I can see in the telegram group, people are asking questions and those who know the answer, they are discussing each other. So, this way, I hope you are learning and growing together. And this is the beauty of this platform. Like everything is available free of cost. There is no fraud. There is no money involved and pure quality and education is involved. Right? And yes, Ravi, I am fine. So, actually, weather is changing frequently. So, that's why I just caught cold and cough. And now I am fine. And I have all your blessings. So, I have this boot camp. So, I know I have to finish. So, with the blessings of God and your support and blessings, I am here every day with you, whatever day I have planned. So, I hope you are also enjoying the journey along with me. And you can see the consistency like today's number 47. And today we are going to complete total 12 weeks. And I still remember the first session day zero I did on 17th of January and today is 13th of April. So, like you can see three months are almost completed and how fast time flies. Right? So, those who are watching this for the first time this session, so they can just go through this slide where everything related to me is mentioned. Moving forward, so I hope everybody is following all the virtual learning best practices. So, keep on creating your own notes so that whenever there will be any opportunity for interviews, so you can just explore them because whenever you create your own self created note so that then it is very easy for you to revise. And I am also sharing interview question and answer. So, I already shared admin LWC and flow related question and answers. A picks and development related is pending. So that I will be sharing maybe this week. Right? And my emphasis is always on practice. Right? Because if you do practice, you will learn code. So, you need to be consistent and do regular practice. Right? So, if you are consistent enough, then you will be able to learn the programming. Right? So, if you are like this was the idea behind the bootcamp like people are not consistent in learning. So, what I decided I thought like let's create a bootcamp in such a way so that every week day by day people will be doing regular practice. And I hope this bootcamp is helping you in that way. So, like today there will be little change like from last two sessions what we are doing. I am just explaining scenario and then we are discussing the doubts as well. If you need to discuss doubts among yourself. So, just follow this telegram group and like more than 2000 people are part of this group. So, you can also become a member if you are not and you can also have discussions with other people. So, today week 12 is going to complete and next week this trigger part will also be completed in week 13. And week 14 we will be doing the Apex test classes. Right? So, I think there will be three, four more weeks where we will be discussing about Apex trigger. And there is lots of requirement for integration. So, I am just working on that. So, I found one guy who will be delivering the sessions basis on Apex integration because he has done lots of training and has hands-on experience. So, I will have that person with me and we both will be helping you to understand Apex integration. Right? So, soon I will be updating the session tracker so that those sessions will be there. And what I decided to keep one week for visual force or maybe like two, three sessions for visual force so that you will be having brief idea like how visual force works. Right? So, if you have not followed this platform so believe me soon this platform Sanjay Gupta Tech School will become a big platform because I am interacting with lots of instructor and trainers as well. So, soon one by one they will be coming on this platform and they will be delivering all the sessions free of cost. And you already know like I have already announced one more bootcamp that will be starting from 20 April. So, it is on cyber security. So, like within two, three months there will be one more. So, this way I like I will be covering all the Salesforce related stuff and other technologies export will be coming here and will be delivering condolent for you free of cost. Right? So, this YouTube channel will be doing live session throughout and everything will be available free of cost. No one will be asking to you like pay this much amount and we won't be doing any fraud with you. Right? So, only quality and we just need your time and consistency. Right? So, just share this channeling with everybody who ever is related to tech so that whatever technology they need to learn. So, gradually there will be different different bootcamps available and they will be notified whenever it is available. Okay. So, I can see in the comment or in the chat like as synchronous apex. If you, Rajiv, if you go through the session tracker so I think there it is available. Let me just show you that. So, if you go to the session tracker, so here everything is mentioned. So, week 13 will be for apex test classes. No, I just need to modify the sequence. Right? So, there is some number mistake is there. So, week 12 we are already running and then we have apex test classes. Then we have as synchronous apex as well. After as synchronous apex, I will be adding integration and visual force pages. Right? Then I will be modifying this. So, prerequisite like HTML CSS and JavaScript is also prerequisite for aura. So, I will shift and modify it accordingly. Right? So, I will be covering everything in detail. So, no need to worry. Just follow this session tracker and you will be having everything with you. Okay. So, moving forward. So, first of all, we need to understand how before delete works in apex trigger. Right? So, this is our fifth event. Right? So, we understood how before insert works, we understand how after insert works, then we did before update, we did after update. Now, this is the fifth one which is before delete. Right? So, whenever you delete any record and it goes to recycle bin. So, before that, if you want to apply something, some operation, so that you can do with the help of before delete. So, for example, if you want to apply custom validation, you want to throw an error like if you are deleting a record and certain criteria matches and if you don't want to delete that record and you want to prevent the deletion. So, that kind of stuff you can do with the help of before delete. So, here you can see one scenario is mentioned which says account record cannot be deleted if active is yes. So, whenever if you try to delete particular record and suppose account record if account active field is equals to yes, then you won't be able to delete that record. Right? So, I will be implementing the solution for you and let me just see I can see few comments in the chat. So, I practiced yesterday and today's session along with exercise now day by day I'm getting confidence. Yeah. I mean, I am happy for you like because of me, you are able to create a schedule for you. Right? So, that is very good. And I want this. So, at least after three months, you are able to have a schedule because if you have a schedule, then only you can do regular practice and you can have a confidence and as if your question is already answered. Ramu, thank you for liking my consistency and knowledge. And Praveen, I have followed your practice and I use videos and implemented trigger testing also. Okay, that is great. So, you are ahead in this boot camp. You did all the test classes as well. So, whenever I will be discussing about test classes, you will understand more and you will be able to ask questions. So, someone is being monetized saying my voice is little low. So, is it so for everybody? Because you can see my mic is just with me. It is closer to me. So, like, if I speak more louder, so I think it will be not like suitable for your ears. So, let me know. Others are also facing this problem or my voice is clearly audible. Okay, so Vikas is saying please take different scenarios which you take in the previous playlist. So, like Vikas, I already created lots of scenarios. So, now it is very difficult to create more scenarios, right? Because there are lots of scenarios which are in form of recorded videos. So, right now I am doing live session. So, the benefit of live session is you can ask questions, right? And I know most of the people have not gone through all the videos. So, that's why whatever scenarios I have created. So, I am just explaining those. If I will be getting any new scenario, so surely I will add that. But, okay. So, thank you everybody for confirming. I am audible. So, let's just implement the scenario. So, I hope you understood the requirement whenever account record is deleted. So, if active is yes, we won't be able to delete it. Right? So, I am going to implement it and jumping to developer console. So, here you can see I already have account trigger implemented. And this trigger also I need to implement in this account trigger only. So, here we have four events already added. So, now I am going to add one more that is before delete. So, now I have five, right? And here I am copying it and pasting it. So, this will be another block. So, it will be known as trigger dot is delete then is before. And I am deleting these statements. Right? Now, I am just saving it. So, I just created the structure. Now, I am going to implement a method here. So, my method will be public static void and prevent deletion. Right? Now, the question is, sorry. The question is whenever you delete any account record or you delete any record, no matter what object you are using. If you delete any record, so that record will be considered as new or old. So, your answer should be old because you are deleting any existing record. Right? So, if I take you here in this exercise sheet, so I just provided a screenshot. So, just focus on this. Focus on this screenshot. It is very important. So, right now we are discussing about before delete. So, in case of before having anything trigger dot new and trigger dot new map. Right? So, in case of before delete and after delete, you won't be having anything in trigger dot new and trigger dot new map because new records won't be created. You are just deleting the existing record. So, the data will be available into trigger dot old and trigger dot old map. Right? So, I hope you are getting this point and this screenshot is very much important for you. So, just go through with this screenshot and understand everything. Like you can just go through the previous events as well because in previous events you can see we used this trigger dot new, new map, old, old map. So, new is basically list, old is basically list, new map and old map are maps. So, in before update and after update everything will be having data. But in other cases you just need to remember which list and map will be having data or which won't be having. Right? So, yeah, I just corrected the video part. I like every day internet is like having some issues. So, that's why video got stuck. So, I think with this table you are able to understand it. So, now what I will be doing in trigger from here I will be calling that method. So, method is available in accountriggerhandler.preventdeletion and here I need to pass trigger dot old. Okay. So, from here I am passing trigger dot old. So, trigger dot old means old list. Trigger dot old means old list. I am not passing old map. I am passing old list. Right? So, this is important to remember. If you are working with deletion you need to pass trigger dot old. And here I am facing an error. So, I just need to save it first. Right? So, from here I am passing it and if I pass that trigger dot old. So, those records I will be receiving into ACC list. Okay. So, this way you will be implementing your method. I am saving this as well. So, trigger is getting saved and here we have handler. Right? So, here I need to implement the logic. So, this time you need to remember this ACC list having the old records. Those we are trying to delete. Now, I need to implement a loop account ACC then colon ACC list. Right? So, what will happen? The account list will be having all the data and one by one that will go into this ACC variable. Now, you need to apply if condition and check ACC dot active. So, active is a field if its value is yes. So, you need to prevent deletion of this record. So, what you can do? You can write ACC dot add error. So, add error is basically a method. Which throws an error on the record. So, we can write active accounts cannot be deleted. Right? So, this way you can just use this ACC dot add error. So, whenever you are trying to delete any account record and that account records active field is yes. So, this error will be thrown automatically. So, it is showing some errors. So, I need to use double equals to I use single equals to that's what that's why it was showing error. So, use double equals to for comparison then I'm saving this code again. So, now it is saved. There is no error and trigger is also saved. Right? Now, if I try to delete any account record if I go to account. So, if I open any account record. So, I need to move to details and here you can see active is yes. Okay. Now, I'm trying to delete this record. So, it is asking are you sure you want to delete this account? Delete. And here you can see it is showing error message active accounts cannot be deleted. Right? Now, if I change this active from yes to no and save it. Now, if I try to delete it so it will be deleted. Yeah. So, here you can see account ACC three four zero one was deleted and it goes to recycle. Right? So, I hope this way you understood how I implemented this trigger. Now, what I need to do I have some more requirements here. So, in Salesforce we have a feature that is known as custom label and custom labels basically we can use so that through configuration we can create some labels and those labels we can use in our code to show error messages. So, let's understand it with an example. So, for example, your development team implemented this code for you and in the organization this code is deployed and your application is working. Now, by any chance you need to modify this you need to modify this error message. Right? So, this error message is basically available in the code and in your organization you have an admin who doesn't know coding. So, that admin won't be able to modify this message because it is written in the apex code. So, instead of writing these type of messages in the apex code what you can do you can just create a custom label and that custom label you can use here and that custom label from UI will be editable. So, now I am going to show you how you can create custom label and how you can use them in your code. So, from here I am searching for custom labels. So, right now I don't have any custom labels so I am creating one. So, here you need to provide short description. So, I am writing it as prevent account deletion and here we need to write the values. So, value I am picking from here. So, value will be this message and I am just pasting it here and save. Right? So, this way I just created this custom label. Now, I can just copy this name the API name and here I just need to replace it. So, I am removing this part and I am writing label dot and that API. Okay? So, this way instead of writing that message directly I am using this label. So, in the code I am using this label. Right? Now, anytime if you need to modify the message. So, what you can do you can go here search for custom label and then you can edit and anytime your admin will be able to modify it. Right? So, here I am just writing label demo. So, this way I just modified this and this modification will impact that code automatically. So, now if I delete any account record where active is yes. So, here active is yes. I am going to delete this. So, here you can see the message is available and it is having that label demo added. Right? So, this way this is important and generally this is part of best practice. So, if you have any message available and you want to show it. So, instead of writing it directly you can leverage the custom label functionality. Right? So, I hope this is very useful for you and if you are a beginner. So, beginners generally don't know about this best practice. So, you can just apply it. Right? Now, another requirement is we need to apply a check that only system admin profile user can delete an account. If you are logged in as non-system profile user you won't be able to delete. Right? So, here in our code we need to apply profile check. Okay? So, now I am going to modify the same code so that I can show you how we can apply the profile check. Right? And after that I will take all your questions. So, if you have any question, any doubt you can just post that in the chat so that after this explanation I can pick your question. So, before starting the condition, so here I am going to write profile P equals 2. So, here I am writing a SOQL. So, we actually need to query the ID of the profile. So, here this way I am writing the SOQL. Right? So, what I did? I just created an instance P. So, profile is our object. Profile is our object. So, whatever profile you create it goes to the object named as profile. So, you can use it and you can query profile object through SOQL. We are just querying the ID. And here in the where clause I am mentioning the name of my profile. Right? Now, ID will be available into this P. So, what we can do? Here we need to apply the condition. So, I am going to modify this condition. So, I just need to get the current user's profile, the logged in user's profile. So, I am writing user info dot, then get profile ID double equals to, sorry, not equals to P.ID. And here I can apply R. So, basically what is happening? We are checking the ID here. So, if ID is like current logged in user's ID is not equals to system admin. So, this error will thrown. If ID is system admin, if current logged in profile is system admin and active is yes, then also this error will be thrown. So, any condition is true. If ID is not matching or active is yes, in both the cases your error will be thrown. So, what you guys can do? So, here right now I am logged in as system admin. So, this profile check I won't be able to demo. So, what you can do? In your org you have one more user. So, just log in with that user and try to delete an account record where active is yes or active is no. In both the cases you will see an error. Right? In case of yes, you will see an error. But in case of active is no, then also you will see an error. Because your logged in user profile won't be equals to system admin. Right? So, I hope this way you are able to understand how we can implement different different requirements with one scenario. So, now let me take your questions. So, Rajiv, if you want to make a field unique, so I think the best way is to leverage the field. Like whenever we create the field, so there is an option. And if you want to make it unique through code, so what you need to do? Whenever you are creating any record, so you need to query all the existing data. So, that is not a good practice. Because if you are making a field unique, so you need to compare its existing record values. So, I think if you want to make a field unique, so you can just make it unique from that field itself, not through code. Amia, I think after this bootcamp I can plan for QA because I need to arrange some consultant for you who can guide you on QA stuff. So, let me first complete admin and development stuff. So, admin is already completed and we are about to complete our Apex part. So, maybe in two, three weeks Apex related stuff will be completed. Then we will pick Visualforce, integration and then Aura, LWC. So, I think by the end of June or July, everything will be completed and then I will focus on QA or BA related stuff or cloud specific. So, Shubham, the recording will be available once this session ends. And I think in live session also you can go back and watch. Yes, Vikas, so integration will be there. So, just have faith on me. I am arranging someone who can guide you on integration because I don't have much experience on integration. I know the basics. So, I have one guy who knows the integration, so we'll do that. So, Akula, Sandeep, we don't need to create custom label for every trigger. So, like if you have created a custom label and you want to reuse that custom label at many places, so that can be done. So, one custom label can be used at many places, but it will be having one message, common message. So, if you need different, different messages, so you can create that many custom labels. So, Lakhira, Ankita, Ankita, actually add error method we are using to throw an error. Add error, I am using to throw an error. If you use custom label, then also you can use it. If you don't use custom label, then also you can use add error. Okay, so, Venkatesh, user info.get profile ID means current logged in users profile ID. So, Bhanu, the category means you can divide, like suppose you are using some custom labels for account objects, some custom labels you are using for other objects. So, this way you can categorize, like the custom labels which you are creating, it belongs to which category. So, it is for your understanding. If you don't provide, then also it will work. So, Sarla, I don't have any example of access management. I also need to understand because I don't have much idea about this terminology. So, Jaya Hindu, yeah, we can customize the error message, but through custom label. So, in the custom label, whatever you write that error message will be shown. Yes, Vamshi, you can, like it is live and you can see people are asking questions and I am answering. No, Jaya Hindu, you cannot customize the error message box. If you need, then you need to use LWC for that. So, right now it is standard, you cannot customize. So, when I'm like these opportunity product price book, these are related to sales cloud. So, I think I will be having separate bootcamp for that. So, in that you will be able to understand. So, those who are asking about integration, so it will be done. So, I think this weekend for sure I need to modify the session tracker. Then only you will realize like integration will be happening. Okay, Srivalli is saying it is updated up to May 4. Yeah, so I need to work on this. Don't worry, it will be updated. So, yeah, after this I need to put visual force and integration stuff. So, I will be working on this sheet. So, everything will be done. So, here you can see days are mentioned, date and time I need to mention. I need to actually redesign it. I need to redesign. So, I just added initially. So, I will be modifying, no need to worry. So, Sanjit, this you can do with the help of permission set. Okay, so this is nice question, custom setting and custom metadata setting. Yeah, this I will do. So, let me just add it into the tracker. So, maybe next week I can do this stuff. So, I just added it and I will be having some example. So, Vamshi, I don't think we have a limitation for custom label. So, it is configuration feature so that you can use directly in your code. Yes, Satisha, profile ID is actually fetching the ID of profile of current logged in user. Yes, Vishal. So, bootcamp, this is a complete bootcamp which will cover integration and LWC as well. So, don't worry, everything will be covered. Okay guys, so moving ahead, we already discussed about before delete. Now, I am going to discuss about after delete and after undelete. So, first I will be implementing one scenario and that scenario will be for after delete and the same scenario I will be leveraging for after delete. Okay, so this is our requirement that I am going to implement. So, the requirement says when a contact record is deleted, then we need to update total contact count field on related account. Right? When a contact record is deleted, then update total contact count field on related account. Right? So, we are assuming like whenever we are inserting any record, so that count is like increasing by one. But if we are deleting, so it should be decreased by one. If one contact is deleted. Right? So, it is kind of rule of summary. First I am going to explain delete then undelete and then I will implement insert as well. So, it will be kind of rule of summary at the end. Right? So, just focus on understanding. It is very important and here like we need to focus on contact. So, contact is being deleted. So, right now trigger will be on contact, not on account. So, right now whatever we have done, we have done on account only. But for the first time, we are going to implement code for another object that is standard contact. And we need to make sure this total contact count field is available on account. So, if I go here and check under object manager. So, I am moving to account and here I am going to see whether that field is available or not. So, total contact count, yeah, this field is available. And if I open this field. So, here you can see its default value is zero. Its default value is zero. So, now what will happen if I open any account. So, here you will see total contact count is zero. And if we delete, so on deletion it will be recalculated. Okay? So, basically you need to assume wherever we are inserting any contact related to account. So, the value of that total contact count is one. And if you are deleting, then it becomes zero. Right? So, what I am going to do, I am implementing it for delete. But the same method I will be calling for insert as well. So, that first it will be increased by one and then it will be decreased by one. So, that delete you can realize. Okay? So, jumping here, I am going to create new Apex Trigger. So, it will be known as contact Trigger. And this I am going to create on contact. Okay? And it will be after insert, after delete and after undelete. So, these three events I will be performing here. So, this is for insert and after. Then I have for delete. Then I have for undelete. Right? So, this way I just created the trigger. Now, I am going to create trigger handler class. So, naming it as contact trigger handler. And you can see I am just following all the naming conventions. So, whenever I write any code, so I apply all the naming conventions. So, for this demonstration also I am applying all the naming conventions. And now I am going to implement the code for you. Right? So, here I am going to implement a method public static void total contact count. And here we will be receiving the list of contact and storing it into con list. Right? So, inside trigger. So, contact trigger handler dot. The method name is total contact count. So, it's c. So, it's c should be capital. So, from here I will be passing trigger dot new. Now, I am just copying it, pasting it here. And from here I am going to pass trigger dot old. So, whenever we create any record, so it goes to new list. Whenever we delete any record, so it goes to old. So, I am going to call this method for both the events after insert and after delete. Right? In case of insert, if you are creating one contact related to one account, so that counter will be increased by one. And if you are deleting, then it will be decreased by one. So, now here what I am going to do, I am going to create a list of account, creating a set of ID. Now, I am going to implement a loop on con list. So, basically suppose you deleted 100 records, 100 contact records. So, there may be chances few records are not related to any account. Few records, few contact records are not related to any account. So, we need to remove those contacts. We don't need to count them because if contact that you are deleting, if it is not linked with any account, so you don't need to do anything. If the contact you are deleting, if it is related to any account, then you need to just do increase or decrease. Right? So, here I am writing if con dot account ID is not equals to null. It means the contact which you are deleting, if its account ID is not null, it means your contact is related to particular account. Right? So, in case of insert, also it will happen. If you are inserting any account record, then also it should be connected with any account, then only you will be increasing or decreasing that counter. Right? So, if it is connected, then what you can do? Just add the ID of that account into this set. So, this set will be collecting all the account IDs. Right? So, this ACC ID will collect all the account IDs. So, I hope till here you got the requirement and whatever solution I have presented so far, you are able to follow it. Right? And if you have any doubt, any question, so feel free to raise that question in the chat so that after implementation I will be able to answer. So, finally what will happen? This whole scenario will be creating the roll-up summary as well. Okay? So, with this same example, like we are about to implement a roll-up summary. So, here you can see insert, delete and undelete all three events are available. So, it is kind of roll-up summary. So, what will happen? You will be able to count like how many contacts are related to particular account. So, if you insert so that count will be increased, if you delete that count will be decreased and if you undelete again it will be increased. Okay? So, moving forward now what we need to do? We have the account IDs which are related to particular contacts. Right? So, now I am going to leverage this ACC list. So, here, okay, instead of that ACC list, I am going to write SOQL in the for loop. In the first line of for loop not inside the for loop. So, I am writing select ID and I think name is not required. So, select ID and then inner query from contacts then from account where ID in ACC IDs. Right? So, this way what I am doing? I am just querying parent child. So, query is applied on parent but the parent account will be getting all the related contacts as well. Now, what you can do? So, ACC dot total contact count equals to ACC dot contacts dot size. This we already discussed, like what is size? Okay? So, this we already discussed and I hope everybody know what it means. So, it will be calculating size of this contact list and it will be stored in this and then what you can do? Add this account into this ACC list. Now, here we need to check ACC list dot is empty and here you can write update ACC list. Okay? So, this way what we did? We just queried all the related records. Those are related to that particular account and what will happen? Like total will be calculated through this size method and it will be stored in this field and results will be there. So, right now this method we have called twice here in case of insert and here in case of delete. Right? So, if I come here, so here you can see total contact count is zero. Now, if I go here and create new contact and I am just saving. So, it is linked with that account. I am just saving it. So, you can see one contact is created if I go to details. So, here you can see total contact count is automatically one. This way our insert operation is working. It is counting it by one. Now, if I go to related and create one more. So, I am creating one more. So, now it is having two related contacts. So, if you go here, so you can see total contact count is two and we have one more total contact. I think some flow we implemented so that is also working. But this field we are updating with the help of trigger. Now, if I go and delete particular contact. So, contact is deleted if I go here so you can see. So, this total contact is two because in flow we did not implement delete operation. But here in trigger we implemented it for delete as well. So, total contact count is one instead of two. So, this is this way it is kind of roll up summary. Now, what will happen if I call this method here as well in undelete. So, this is the demo of undelete. So, the contact which I recently deleted it is now in recycle bin. Now, through recycle bin if I undelete that contact. So, it will be considered as a new contact now. So, it will go to trigger dot new. And again this whole logic will work and that will be counting the total contact count by plus one. So, this way it will be working. So, undelete is kind of similar to insert operation. So, now if I go here and I am going to open recycle bin. So, I am going to open it in new tab. So, here is our account now coming here. So, we deleted a contact. So, it is here. Now, I am going to undelete it. So, restore it is undeleted. Now, if I come here and refresh it should become two. So, here you can see two contacts are available. If I go to details. So, you can see total contact count is now two. So, this way the roll up summary thing is also working. Right? So, if you are inserting it is increasing. If you are deleting it is decreasing. If you are undeleting again it is increasing. So, this is a common scenario like when a contact record is inserted, deleted or undeleted. Then update total contact count field on related account. So, it is basically treated as roll up summary. Right? So, I explained you all the events in detail. We discussed about before insert, after insert, before update, after update, before delete, after delete, after undelete. Right? So, all the things I explained with the help of example and we completed roll up summary as well. So, I hope you understood everything and this is it what I planned for today's session. So, now if you have any question you can stay otherwise you can just do whatever you want to do. But do practice because if you go here in the exercise sheet. So, here these examples are already listed that I demo. So, anyhow you need to do these and few more are available. So, just try those as well. Okay? And next session will be on next week Monday. So, till then practice everything if you are behind, if you are watching the recording and if you are behind. So, you have Friday, Saturday, Sunday. So, just do practice as much as you can. Right? So, now I am just jumping to the Q&A part. Okay? Vamshi is saying try to add custom permission also. Okay. I will think about it as well. So, let me just take a note of it. Okay. So, platform event also we need to discuss. So, this is good. So, platform event and platform event triggered flow is remaining. So, both I need to cover. So, this is nice cat. So, I will redesign next week sessions because I need to complete the best practices as well. And we are about to launch our one more boot camp. So, next week Thursday the Salesforce session won't be available. Instead, we will be having this boot camp launch. And next week I will do some minor change in time as well. So, I will update you about that. So, next to next week onwards there will be parallelly two boot camps will be running on two different times. So, I will be updating you about that next week. Okay. What is the purpose of category? So, Bhanu, this I already explained in custom label we have a category. So, it is for your reference. Like if in your code you have lots of labels created. So, you can define a category like this label I used for this object, this label I used for this object or like whatever functionalities you are having in your code. So, accordingly you can put the category. So, Sanjeev is asking could you please explain the condition block once again. So, which conditional block can you please mention the line number so that it will be easy for me. Yeah. So, Janna, this is good question why there is no event for before undelete because in case of undelete it is a recycle bin. So, from recycle bin to database once it is available in the database then only you will be able to do anything. It is in recycle bin and from recycle bin it will come to actual object then only you will be able to do some changes in that record. So, that's why before undelete is not available and in recycle bin you won't be able to do any changes. So, once it is saved to the database then only you will be able to do some operations. So, Grinath I demoed this roll-up summary in account and contact. The example which I demoed it is actually doing roll-up summary between account and contact. So, trigger I wrote on contact but it is summing up the result on account you can see here. So, when in this scenario we don't need to create after update because we are counting number of records. So, if you update any record like if you are updating any contact so new contact are not adding under account. So, number of contacts are same. Yeah, so in this scenario like if you are changing the account in that case you need to create update. Yeah, this is nice catch. So, if you update account anyhow then you just need to create the contact sorry you need to create the update one. So, just try it yourself right? Vikas is asking if the account has three contact and contact have field amount. So, show the maximum amount on account from contact. Yeah, that you can do you need to apply a logic. So, inside loop you can apply the logic and then after completion of loop whatever max you will find you can just assign that into the field. So, you need to implement the logic for this Vikas. Okay, Vamshi is asking please check the ID whether it changes or not. This is nice question. So, when we delete and when we undelete what happens? So, I also need to check it. So, what I am going to do from here I am going to delete a contact. So, first of all I am going to open it and I am copying it it's ID right? Now, I am going to delete it moving to recycle bin and I am going to undelete it. So, it is available here and I am just opening it and control FV. So, yeah, I think it is same. Hmm, ID is same. So, we just validate that as well. Okay, Ananta is saying please explain once again. So, can you tell me which part you want me to explain? Yes Praveen, we can use map instead of set but we are not using nested loop. So, that's why I just use set instead of map. We don't need to search anything. If you are implementing nested loop then you can use map and then do the functionality with the help of that. That is possible. Guys, please don't ask to explain each and everything again because it will take lots of time. So, just ask particular line numbers where you have doubt. So, I can just show you the code once again. Everything is available in front of you. So, just mention the line number which you need to be explained again. So, I will explain that code. So, till here everything is simple like we are iterating on contact and checking whether contact is connected with account or not. If it is connected, so account ID won't be null. So, we are adding those accounts into set and through set we are querying parent to child records. And this I already explained while working with Apex like how to count number of records and we are adding into the list and then updating. Okay, Jana is asking can you show before delete holding portion one more time? Yeah, I can. So, here is the before delete. So, this I explained for before deletion. Okay, so let me take more comments. So, Ankita is asking con dot account ID not equals to null. So, basically here what we are trying to check, we are trying to check whether the contact which you deleted or inserted or undeleted. Actually that contact is related to particular account or not. So, account ID is a lookup. It means it is connected to particular account. Yes, Jana. So, I will be covering this recursive trigger and whatever I know I will be covering. Vishal, this is separate topic deployment process and GitHub. So, I think after all the sessions maybe we'll be having one week for deployment and GitHub branching. So, that you understand. So, let me just add that. So, at the end I'm going to add deployment as well. Right. So, I just added so that I remember. Yeah. So, first this you need to do yourself data import and export. So, just create Excel sheets and try it yourself and let me know if you need my help. So, but first try yourself so that we can discuss it quickly. Yes, Jaya Hindu will make bootcamp on sales cloud but not prior to this. So, first I will be complete completing all the apex stuff. Then we'll do integration then aura and LWC and then we can pick any other cloud. So, Jana for label short description means the name of the label and yeah. So, short description and name is basically API name unique name. So, Sanjith basically custom labels are not specific to object. They are independent to object. Yes. If you delete through data loader then also your trigger works. So, Pankaj for this I think you can watch motivational videos because this can be done through consistency. Don't think much and do best whatever you can do. So, if I try to explain so this session will become a motivational lecture. I don't want to go in that direction. So, just do focus. Don't think much because nowadays for like what folks do they they waste their lots of time thinking I can do this I should do this. So, instead of thinking much just do that. It will save you lots of time. And if you spend less time on screen like mobile phone or laptop watching applications those are not useful. So, to be honest this year or like last year also I didn't watch any web series or my screen time is very less. I just focus on my dreams and I promised with myself like I will continue this practice for two to three years right. So, in two to three years I will make this platform so big so that it will run automatically and then in my free time I can enjoy the web series. So, this way you need to focus right. So, if your goals are big so you need to leverage your time accordingly. So, this way you can maximize your time. I do the same approach. Even I'm missing the IPL as well. I never like I didn't watch any match till now. So, like you need to sacrifice something if you want to get something. Yes, Janna if nested loop is there you can just remove that inner loop with the help of map. So, Sunil for this you need to write SOQL. So, I think this SOQL we already discussed. So, where account name like test then percent and after that you can write all rows. So, if you write all rows so your SOQL will run for recycle bin as well. So, Ankita exercise sheet link is available in the session tracker and in the video description as well. So, here you can see this is the link Salesforce exercise sheet link. So, let me copy and paste it in the chat as well so that you can have it. So, it is in the chat now. Okay, Sanjit is asking to repeat line number 12. So, okay, let me go to the code. So, line number 12. So, line number 12 is basically SOQL. It is parent to child SOQL. We are querying account whose ID is in this ID set and along with all the contacts will also be fetched. Okay, Sunil also asked one important thing, Apex sharing. So, it is very simple. You just need to use with sharing and without sharing but surely I will include that. Let me just note it down. Right, so I will make sure I will be having one example for each topic so that you can understand. Okay, Sanjit, I am happy. I was able to clear your doubt. So, I think yes. So, next question is can you please explain roll-up summary using map? Okay, so for that, I will be having session on next week. So, we'll show you that implementation next week because it will take lots of time. So, today's session is almost about to end. So, I will explain roll-up summary using map next week. Let me make a note of it as well. So, Praveen, you are saying if you use line number 12 outside loop. So, if you use it outside loop, so this way you need to write. So, what you can do, you can cut it from here and you will be creating a list of account. So, you can name it account with contact list and then you can write your SOQL. So, this way if you write, you won't face any error. This way you can modify. So, if I save it, so it will work fine. Okay, so I hope everybody understood whatever we discussed today and day by day you are getting enough knowledge. So, keep on doing practice, be consistent and market is getting good. So, there are lots of opportunities. I can see on LinkedIn people are posting like they are getting jobs. So, keep the hope alive. Do lots and lots practice. And if you are fresher, there will be opportunities. If you are experienced, then also there will be opportunities to upskill and to have a better job, whatever you are doing. So, everything will be possible if you have enough knowledge. And knowledge can come through practice only and that you need to do on daily basis. So, sales force is very vast and you cannot learn it in a single day. So, you can see in three months we are about to complete Apex trigger only and lots of topics are still there. So, in next three months we will be completing those topics, then we have lots of clouds. So, this whole year just give yourself to prepare for a sales force ecosystem. And I am sure like maybe by the end of this year or next year beginning, if you have whole lot of knowledge so no one can stop you to get a job of your choice. Right? So, those who are learning life, so I think they can ask question. But those who are joining, sorry, those who are just watching the recording. So, for them like we have that telegram group so you can discuss your doubts there. And you can just ask your questions in the comment section of the video. So, and like nowadays I am not receiving any review or feedback so this is a request. Please provide reviews and feedback every week so that I also receive some motivation from you. Right? So, it is two way process. I am motivating you. So, you need to motivate me as well. Right? So, I am also a human being and I also need some motivation. So, my motivation is you. If you express your views about the bootcamp and whatever I am doing for the community so it will boost me up. And I can do more and more for the community. Yes, Rivali, so have faith. It will be better. So, you all know like change is constant. So, nowadays market is down but gradually it will increase as well. It will grow as well. So, up and down is her part. So, whenever like market is down so that is the best time to learn. When market is up that is the best time to apply those learnings. So, in this tough time if you don't learn, if you don't upskill so whenever market will be good so you won't be having any skill to apply for interviews. Right? So, don't think much about that because in this bootcamp the beauty of this bootcamp is you don't need to pay anything. You are not wasting anything. You are learning things day by day. So, what is the problem? Right? So, just do whatever I say. Learn new things. Nothing will be wasted. Right? So, Salesforce is very vast ecosystem. So, you will surely find a job of your dream. Yes, Pankaj, cybersecurity is linked with Salesforce. So, there is one job role available in Salesforce that is related to cybersecurity and cybersecurity is related to other ecosystems as well. So, you know like wherever digital or IT is available cyber security is needed. Right? So, it is related to Salesforce as well as other technologies as well because if you are using internet it means you need to use cybersecurity. Right? So, even if you don't get a job or you don't want to do a job in cybersecurity still my request will be from everybody like just attend that six to eight weeks bootcamp that you know actually what happens in cybersecurity. So, sometimes we also need to learn the things upon which we won't be working anytime but we should know as an IT expert, IT engineer, we need to know different technologies like how they are working. You never know whenever you get a chance to interact with a person in your team who is already working on that profile. So, if you know a little bit about that particular profile, so you will be interacting in much better way. Right? So, if you have knowledge of different different domains so it will make you more powerful. So, Pankaj's timing I will be letting you know next week. So, the first session will be on 20 April at 8.30 p.m. but the regular timings I will be telling you next week. Okay. So, thank you everyone those who appreciated. Okay. So, thank you so much. I don't see any more question to be explained. So, thank you so much guys. See you on Monday with new topics.