 Hello everyone. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So this is day 34 of Salesforce Learning Bootcamp. And today the topic which we are going to discuss is S-Objects as Data Types in Apex. So we are learning data types and yesterday also we discussed about primitive data types and today we will be discussing how we can use S-Objects as Data Types. So very warm welcome to everybody. Good evening, good morning. I know from different location folks are joining. So hello and welcome to everyone. So I will just wait for more folks to join and then in couple of minutes I will be starting. So hello Pulkit, hello Akshay, hello Venkat, hello Greenat. So numbers are increasing. It is right now 50. Hi Vira, hi Dharini, hi Balu, good evening. Numbers are increasing. So I am just waiting for more folks to join because today's topic is very much important. Here we are going to link our admin part with development. So in admin part you know we implemented lots of objects. So today we will learn for the first time how those objects we can use in Apex programming. So hello everyone. Hi Nishant, Badal, Divya, Pranay, Venkat, thank you for appreciating my efforts. Okay, so I think more than 70 folks have joined. So this is a good number. And I know in a few minutes this number will cross more than 200 folks. So if someone didn't join, if you want to remind them just send a message so that they can also join because today's topic is very much important. So I am just going to tell you briefly about the beginner slides. So if you have joined or started this bootcamp from today only, so this slide will give you little insight about me, what I do, what I have done, and what certifications I already completed in Salesforce ecosystem. And like from the beginning from day one, I hope you are following all the learning best practices. So I can see now in telegram, almost every hour, people are discussing doubts. So that is very good. And you are following the practice exercises as well. I can see people are asking doubts, few folks those started in the middle, they are doing previous admin things and focusing on the development stuff as well. So keep on doing these things so that you can understand the concepts and you can get ready for the jobs. So this is the important word. I just follow this word properly like it is consistency. So consistency is the key. So if you want to learn anything, you should be consistent. Right? So if you are consistent, then you will be able to do anything. So please do regular practice so that you can learn each and everything in detail. So I'm explaining all the things in detail on daily. So you can see how consistent I am. So today is day 34. And I never missed any week. Every week at least three to four sessions I'm delivering from January itself and it will go maybe till December. So I am consistent with you. So please consistent with me if you want to really learn Salesforce in proper way. Okay. So today also I will be explaining the topic and we'll do some demonstration and then we'll do Q and A. Right? Okay. So this is the bootcamp timeline and you can see we are in week nine. So in week nine, we are just learning all the fundamentals of apex and day by day things will be complex. So I would request on daily basis, just do proper practice because all the content is available free of cost and Salesforce developer edition or also you can utilize free of cost. So when a teacher is available freely, learning is available freely, platform is available for practice freely and you have time also. So everything is available freely. There is no burden on mind. So I think you can just learn things properly day by day. And if you have not followed any of the platform that is created by me, so just follow immediately and pass this information with other people as well so that if they know, if you if they don't know about the bootcamp, so still if they join this bootcamp in this week, so it will be fruitful for them because every day things will get complex. Right? So ask people to join these platforms so that they can also get daily reminders and they can join the sessions on time. And like in return, I just want your support. I just need 100k subscriber by the end of this year. So this I this is a promise which I did with myself. Like anyhow, I will I will try my best to have more than 100k subscribers by the end of this year. So I need your support because without your support, I cannot go to achieve that number. Right? So I'm doing all the dedication for you. I'm giving you all the quality knowledge. Right? And I'm giving you this every week. So please support my channel because right now it is having very less subscribers. So if it this number reaches, so sale like YouTube will be verifying this channel. And I am going to launch a few more bootcamps. Those will be available freely. So if it goes viral, so lots of folks in India and in different countries will be benefited. Thank you, Major for sending some amount. I will surely buy coffee. So today Navratri started. So after Navratri completes, so we'll surely enjoy. Okay, so let's start the today's topic. And thank you everybody, those who are appreciating. Thank you, Prakash for blessing me. Okay, so today's topic is how we can use as object as data type. So I hope everybody know what is as object. So as object is basically Salesforce object, right? So we have generally two types of object. One is standard object and one is custom object. Right? So now in today's session, we will learn how we can use those as objects so that through programming, we can create some records. So right now what was happening? You were able to create records through UI. Okay, if I take you to Salesforce UI. So if you want to create an record, let's say you want to create account records. So what you will do, you will click on new and from here, you will be filling all the fields, those you want to fill and you will click save and new record will be created. Okay, but today I'm going to show you how you can create records through programming through apex programming. Okay, so that's why what we are going to do, we will be using as object as data type. So whatever objects you have created, whether it is custom, so custom objects also you can use as a data type. Okay, so here you can see we have some examples. So first of all, we have standard as objects account and different variations are available, like how we can create instance or variable through that as object. And at the bottom, you can see through custom API, like my OBJ underscore underscore C is a custom object API name. So if you remember in the admin, I told you, like whenever you are creating any objects, so it is having one API name as well, that is a unique name, right? So that unique name is having underscore underscore C. So you can use that this way, right? So let's quickly understand this basic and then we'll do some hands on so that we can create proper data with the help of apex by creating classes. So right now, to understand this feature, I'm just going to open this anonymous window. And in this anonymous window, I will be writing some code. So for example, if you want to use account, right, account is your s object. So if I take you here, and if I open setup, so under setup, you will find object manager. And under object manager, we have this account object, right? Now here in details, you can see we have this API name. So account s object API name is basically account, right? So you can use it as is. Okay, so here you can see I'm using account now ACC. So this ACC can be known as instance or it can be known as variable for that account object. And then you can write new account so that you can initialize it, right? So this is the standard syntax that you need to use. So I hope you remember like whenever we are creating instance of the class, so we used same syntax in place of account, we used class name, right? So here we are going to interact with the s object. So that's why we are using account here. Okay. So now what we can do, we can write ACC dot name equals to and here I can provide name of the account. So I'm providing name of account as s gts Sanjay Gupta Tech School. And if I want to fill rating, so I'm just filling hot here. So these are the field API. These are the field APIs. Now if you want to see the field API names. So for name, you can see we have API name as name. Right. If I search for rating, so for rating, you can see we have API name as rating. So that I'm using here directly. Okay. So if you want to fill values to particular fields, so you can just write those fields individually. Okay. So this way what we did, we just created instance and then we are trying to fill values into the particular field. Okay. Now if you want to create a record, so if you want to create a record, so what will happen, you can write insert and then ACC. So this statement will insert a record. Okay. And this record will be inserted into the org. Right. So if you want to insert any record, so you just need to use insert statement. So this insert statement will be creating one account record in your org. Okay. Now I'm going to execute this code. Right. So I'm just going to click on execute button. Open look option is already checked. So I'm just clicking on execute. So here you can see we are viewing an error message. So if I go here and if I try to create new account by providing some name, so here if I click on save, so you can see we here also receive an error message because active is a required field. Right. Active is a required field. So if you try to create any record from code, so those validations apply through code as well. So you can see here the error message is showing system dot DML exception. So basically insert statement is DML. DML means data manipulation language. Right. So insert field. Now the reason is required field missing which field active. So this way if you try to run your code and if there is any error, so apex will give you lots of suggestions so that you can fix that error. Right. So I'm clicking on okay. And here I'm going to write ACC dot active underscore underscore C and then yes. Now you might be asking why I use underscore underscore C with this field. So if I take you here and search for active field, so you can see its API name is basically having underscore underscore C. So that's why I am using this underscore underscore C while implementing the code. Okay. So I hope you understood this. Right. So now what you can do you can just click on execute. So locks will be open, but locks will be blank if we click on debug only because we didn't use system dot debug statement. But if you see here, so all the steps are available like while inserting account record, whatever step executed in the background. So you can see all the statements are available here. So this is very this is basically your log. And here you can see all the queries related things are available that we will be discussing later on. Right. So all the limits. So if you already know a little bit about apex, so you might have heard about governor limits. So these are basically governor limits that you can track. So we will be discussing about it in detail later in the session. So right now I'm not going to explain these complex things initially. So maybe in the next week, we will be focusing on these more. Right. So I'm just closing it and opening it. So now what I need to do I need to go to the org like on the UI that application and I'm clicking on accounts. Here you can see this account is created. If I open it, go to details. So here you will be able to see the results. So account name is SGTS rating is hot. And if I go below so you can see active is yes. Right. And I think through flow it is having a related contact as well. One opportunity as well. So through flow record flow, this is happening. Right. So through code, we created one account record and on creation of account record are automated processes are also working. Right. So Tushar is asking, can we find out programmatically which are mandatory or required? So this is the only way like if you are having any error. So through that error, you will be able to identify otherwise through like going to object manager or checking through page layout or validation rule, you can just identify whether this field is required or not because we can make field required through different different ways. So if you want to watch those ways so you can come to my website study Salesforce. So here I have created one video. So you can see we can make field required through these ways. So one like while creating field, there is one option like if you want to make that field required. Another is through page layout, then we can create validation rule and then we can make the field required through trigger as well. So there are four options to make field required. So through code, we won't be able to identify whether field is required or not because we have these all options. So if you want to learn how we can do these. So number 56 video you can watch. So I can just share the link in the chat so that you can go through with this video, right? So I hope you understood how we can create a record through code, right? So it was easy and through anonymous window, we understood this. Now I already told you, we just use this anonymous window for like executing few lines. But the lines which are implemented in anonymous window, these lines won't be saved permanently because a file is not created. So if you want to create a file and you want to store your data permanently into a file, so you will be creating a class and in that class, you can just add all these statements. So I'm just copying these lines from here, close in anonymous window and I'm going to create new class, right? And I'm naming this classes account record and clicking on okay. So this way, this class is created class name, you can use anything. Then here you need to write a method public static void insert data. And here inside curly basis, you can paste the code. Now after pasting the code, if you want to align this code properly, so what you can do, you can just press control a so that all the code will be selected and then press shift plus tab. So first of all, control plus a so your whole code will be selected. And then you just need to press shift plus tab. So it will be aligned properly. Okay, so here this code is available if you run this code now. So I hope everybody knows how to run static method because in previous class we already discussed it. Okay, so here I'm going to add few different values hot, warm, and I'm leaving it as is and account name is s gts to I just modified it because I just want to run this code as well. So I'm just saving this. So this class is saved. Now moving to anonymous window. Here I'm going to write account record dot insert data. So if I run this line, line number nine, if I run this, I just click if I just click on execute highlighted. So that method which we implemented in inside the class that will be executed. So I'm just clicking on execute highlighted. So here logs are available, right? So we don't need to focus on this much. We just need to go here refresh the tab. And here you will see one more record. So you can see s gts to is created. If I open this go to details. So here rating is warm. Right. Account name is available and active is us. And here also in the related list, you can see contact opportunities are created. Right. Yes. So Amit is saying like can we put this name rating active in the static method parameter. So this is nice suggestion. So what we can do? We can receive these values as a parameter. So here I can write string name then string rating then string active, right? And here I will be writing name. Here I will be writing rating. Here I will be writing active. So whatever values are available in these parameters, they will be assigned to these name rating and active field. And these values you will be receiving from method call. Right. So I'm just opening it and from here I'm going to pass the data. So as it is three, then rating hot and active, I'm passing as yes. So this way you can pass the parameters and those parameters will be received here in this line. Right. And they will be assigned. So let's execute the statement. So it is executed now moving here refreshing the tab. So you can see as GTS three is also created with rating hot and active. Yes. So this is another way so that you can just set the data. So through this way you can set different data every time whenever you will be calling the method. Okay. So what I did, I just explained you this first requirement. So right now we are discussing how we can use standard object as data type. Okay. So now we have one more requirement where we need to create account as well as we need to create related contact. But we like yesterday someone asked me can we call one method of a class into another method. So right now I'm going to right now I'm going to explain you how we can call one method of a class into another. Right. So so Vamshi is asking do we need to use this near field API name so no this name can be anything this name rating and active this can be anything but I am using relevant name so that you can relate. Right. But here you can use any name as a parameter name. Okay. But it should be relevant. Yes. We can use extensions for API names. So I think I just showed you one extension. So Salesforce inspector. I just showed you like how you can add it and if you go here so you can just click on show all data. So here you can just find all the field API is label type. Everything will be available. You can just see the data as well. So from here also you can just pick the API names quickly. You don't need to go to object manager from here you can just pick the other extensions are also available so you can use them as well. Okay. So now I'm going to create one more method and there was one question yesterday what is this void and why we are using this void. So today I'm going to tell you the place like void is basically return type and it is indicating this insert data method is not returning anything but right now we are going to return something through this method. Right. So data type I'm writing as ID and what I'm going to return from here I'm going to return ACC dot ID. Okay. So here I just mentioned a comment. So just read this comment carefully. So what I want to say whenever this account record is inserted through this ACC variable. So after insertion the ID of that newly created account record will be available into this ACC. So what I'm trying to do I'm trying to return this account ID. So that's why this ID so this ID is basically now a return type. Okay. What what we are trying to do we are trying to return ID through this method. Okay. So now I'm going to create one more method public static void insert contact. Okay. Here I'm creating ID ACC ID. So ID is primitive data type and I'm creating a variable ACC ID. Now I'm going to call the method ACC ID equals to insert data and here I'm going to pass these values. So I'm just copying and pasting them here and here I'm passing for right then I'm creating contact con equals to new contact. Right. So for contact we we already know like for contact we have for contact we have one field that is required which is last name. So now I'm going to show you one more thing. So if you want to initialize a field API with some value so those you can write in this parenthesis as well. So let's say first name equals to contact one one oh one. And last name I'm assigning as con 201. Right. So this I just randomly use these names and what we need to do we need to assign account ID as well. So I'm writing account ID equals to ACC ID. Right. So that the newly created contact will be linked with the account that we are creating in the above method. Okay. So this way what we are trying to do through this method we are trying to receive ID here. Okay. So this insert data method is written above. We are calling it here in this insert contact method and we are passing these values. So contact account will be created and that newly created account ID will be available into this ACC ID and that ACC ID we are signing into this account ID so that the newly created contact will automatically link with that account. And here I'm going to write insert con. Okay. So this way one more method is implemented and and I hope you understood the place where we used to write void. So here I'm writing ID so that ID can be returned. So we are using this keyword return is a keyword which can return value from one method to another method and whatever value we are returning that will be received here with this ACC ID line number 15. Okay. So now what we need to do we just need to call this insert contact. So insert contact will be calling insert data first. So insert data is basically inserting account. So what we can do we can just rename it to insert account. So here also we need to rename insert account. Okay. So that it should be meaningful. So we are calling insert account account will be inserted and then contact will be inserted and both will be linked as well. Now I'm just saving it moving here. So I'm just searching for flows so that I can deactivate existing flows. So I'm clicking on flow trigger explorer. So on account we have these flows active. So I'm going to deactivate these flows. Okay. I'm just refreshing it so I can verify whether it is active or inactive. So it is an active. Right. So on account creation we don't have any active flow which will be creating any contact or opportunity. Okay. So this is done now. We just need to call this insert contact method. So what I'm going to do here I'm going to call it. So insert contact and here I'm passing nothing. So what will happen it will create one account with SGTS for and one related contact as well. So I'm clicking on execute highlighted. So it is executed. Now moving here refreshing accounts. So you can see SGTS for is created. I'm clicking on it moving to details. So you can see rating is hot and active is yes. If I go to related so here one contact is created and contact first name and last name is same that we provided in the code. So while you will be implementing so you can just use meaningful first name and last name so that you can just relate those things. Okay. So Shivani is asking what is this con dot account ID. So this this is a lookup field here. This account ID is lookup to account. So whenever we create any contact so we have a lookup to account. So through programming we are just filling that right. So this ACC ID is the account ID we are just passing that account ID into this account ID field that is lookup. So that newly created contact will be linked to that account automatically. Right. So I hope you understood this requirement and like I already told you day by day things will be little bit complicated. So you just need to do regular practice so that you can understand the things very well and these things are very easy. But the thing is you just need to do regular practice then only you will be able to understand. Okay. Now what I'm going to do you what I'm what I'm going to explain to you. So I will be creating account with related contact and opportunity in a single method. Right. So right now what I did I just called this method insert account which is available here into another method. Now I'm going to create one more method. So I'm just copying it pasting here. So insert account with contact and opportunity. Right. So I'm just trying to create one method which will be creating account followed by contact and opportunity. Right. And I will be receiving data as a parameter. So here after this comment I'm going to write some statements. So I'm just copying them from here pasting it. So in a single method you can do this. So what is happening here first we are trying to create account and here you can just write void because we don't want to return it. So you can just remove this and here instead of ACC ID we can use ACC dot ID because this ACC variable is available in this method only. So in a single method we created account the newly created account ID will be available into this ACC. So we are passing there that ACC dot ID into this account ID lookup then we are creating contact. Now we need to create opportunity. So opportunity OPP equals to new opportunity then on opportunity we have three required fields name close date and stage. So I'm filling all. So opportunity name is OPP 101 then OPP dot close date equals to so here I am writing system dot today. So system is a class and today is a function that I'm using here. So if you want to use current date if you want to fetch current date in the program or in the apex code you can just write system dot today. So this you can just remember whenever you need date so you can directly write system dot today and then we have stage. So stage name equals to and here you can write prospecting. Okay. Now again opportunity we also want to link with account. So account ID OPP dot account ID equals to ACC dot ID. So above you can see through this insert ACC we will be receiving account ID. So we are mapping it here as well while creating contact and we are mapping it with opportunity as well. Now I can write insert OPP. So with this method the method which we created here with this method three records will be created. So first account will be created then contact related contact will be created and then opportunity will be created and the contact and opportunity that we are creating both will be linked with that account. Okay. So now I'm going to save this code and I will be calling this method in the anonymous window and I will be passing name rating and active so that values will be available so that new account will be created. So here I'm writing this method name. Okay. I will be passing the data. Okay. So account name I'm passing as as it is five rating hot and yes. So I'm just selecting the statement because I just want to run this and I don't want to open the log because I'm not using logs as of now logs will be created but I don't want to open them directly. Right. So if you don't want to open the logs, you can just uncheck this checkbox. So unchecking means logs will be there but won't be open automatically. Okay. So I'm just clicking on execute highlighted. So it is executed. Now I'm going here and I'm going to refresh the tab. So this five is created. If I go to details. So here I can see values are available and you can see account is sorry contact is created an opportunity is created and on opportunity closed it you can see it is today's date. Right. So this way we can have this code. So through programming we are trying to create records. Okay. So few folks are asking how we can provide dynamic date or days after 20 days. So for that you can use date literal. So I'm just going to show you how you can search. So we have date literals in Salesforce. So if you open this link so here you will find everything. Okay. So here we have these things. So for yesterday you can use yesterday today tomorrow last week this week. So these are the literals that you can use directly. So we will be using them later on. But if you want to research so you can just go through with this document. It is very useful and it is publicly available by the Salesforce for reference purpose. So I'm just going to provide this in the chat so that you can also go through. Okay. Now this I'm leaving for you like how we can create related contact opportunity and case. So I'm not going to demo because you just need to create one more record that is related to case. So what I'm going to do I'm just putting it for your practice. So it will be for self practice. So I'm just modifying this document for you. So what you need to do you just need to practice this. Only one. Right. So what you will be doing you will be creating a separate method and in that method first you will create account then related contact related opportunity and related case. Okay. So you will be modifying this method. So what you can do just copy this method and paste it and then add the case related statements also. And and somebody saying other is saying like can we use lists? Yes, we can use lists. But right now we have not studied list. So tomorrow we'll be understanding list then set then map and then together I will show you how we can use those collection data types so that we can create n number of records together. Okay. And few questions I have not picked. So after explanation I will be picking them. So I think now there's how we can utilize standard object functionality you understood. Right. So now what we need to do we need to understand how we can apply this functionality for custom objects. Right. So I just forgot to remove it from here. So I'm removing it from here because I didn't explain it in the demo but you will be doing self practice for this. Okay. So now let's do some exercise for custom object as well. Okay. So I will be explaining you how we can create position record then candidate record. So let's jump here and I'm going to create new class now. So custom s object demo. Right. So here I'm creating one method public static void create position. Okay. So here I will be writing the code so that you will be able to understand. So we need to write position underscore underscore C POS equals to new position underscore underscore C and then you can initialize this at like way. Sorry. You can initialize it this way. So this position underscore underscore C is our API. So how you can verify just go to object manager search for position object. And here you can find the API name position underscore underscore C. So for those folks who didn't join admin related sessions. So they might be thinking what is this position. So it is our part of project. So we did a project which was related to admin. So those who just started development sessions and they know admin. So just go through this project and implement this in your org. This project is basically reference of some trailhead data model that I just customized as per the latest features. So if you go through this project, so you will be able to understand all the object model which is available here. So all these objects you need to create so that you can understand because while understanding apex so like few times I will be taking examples of custom objects. So you should be aware. So just go through and if you can implement it that will be like good for you and all the steps I demonstrated in the sessions. So that playlist is available here. You can just go through with all the videos if you want to see the implementation and if you get stuck somewhere you can just go through the videos and you can just find the solution. So in this document we have everything. If I take you so this is the data model that you need to create then we have reports and dashboard. We have profiles and permission sets. We have sharing things. We have data import wizard data loader exercises. We have formula validations approval process then few flow related scenarios are also available. Okay so if you have not gone through you can go through. Okay now with standard object implementation I showed you like through two different ways we can provide values to fields. One is this like with this parameter we can fill the value and one is like in separate lines we can provide the values. So generally we prefer to provide values in separate lines if you want to fill lots of fields but if you want to provide values to one or two fields then you can use this parenthesis as well. Right so like here you can see for this contact we just need to initialize two fields so we just provided values here and for one we provided here as well. Okay so this also I can just shift inside this parenthesis after comma I can just cut and paste it here so that way it also work and if you want to write first name and last name in separate line so that is also possible you can do that. Okay so here we need to provide values to position fields so I'm going here and just checking the fields or I think it will be better if we open the recruitment app so under recruitment app we have positions tab so I'm just clicking here clicking on new so from here we will be able to find so here you can see we have record types as well and these are the fields which are available for this technical position record type and position name is required field so if I go here and search for name so position name api is name so what I need to do I need to write pos.name equals to and let's say I'm writing mule soft developer so this is my position that I wrote and it this the record which will be created that records position name will be mule soft developer right so now I'm just writing insert position so I didn't provide record type so let's provide record type as well so here basically we need to provide record type ID so right now what I'm going to do I will be providing record type as hard coded ID but that is not that is not the best practice so best practice says you need to query the record type ID and then you can provide that here but right now I have not explained you how we can apply queries in apex so we can query the data in apex but right now we don't know about that so at the moment what I'm going to do I'm just fetching the record type ID manually so I just opened this technical position record type and in the URL I can see the ID I'm just copying it and I'm going to paste it here okay so again I'm reporting I'm repeating the statement this is not a best practice but right now we don't know how to query the records so when we will be learning SOQL Salesforce object query language language then I will show you how you can query this ID dynamically right so that dynamically queried ID we will be filling into this field but right now we don't know so that's why I'm just writing it as hard coded and I'm going to insert it so I'm just saving this code now here I'm going to call it so our class name is this so I'm copying and pasting it here or method name is this so I'm copying and pasting it here and I'm going to call this method so I just selected the statement and clicking on execute highlighted right so I just clicked on execute highlighted so no error it means record is created successfully so if I go here and refresh this tab so you can see mules of developer record is created if I open this so here you can see it is having record type as well technical position and here you can see date it is having today's date okay so this way through code I am able to create position record as well so this demonstration I did so that you can understand we can create records for custom objects as well so Dharini is asking what is apex exact meaning so Dharini you need to watch the Monday's video that is day 32 and there I explained like apex is a programming language of Salesforce if you want to do any operation through code like creation of record, update of record, deletion of record so for that purpose you will be using apex programming so right now we are just getting familiar how we can use this apex programming for backend development right so in today's session what we are learning we are learning how we can create records with the help of s objects so here you can see we are using position so this position underscore underscore c is a data type here actually it is s object but that s object we are using here as a data type okay so the agenda for today's session is how like to learn how we can use s objects as a data type in apex programming okay now I am going to create one more method so next method says to create candidate record so public static void create candidate and here I am going to write field sorry object api so I just need to search it so we have candidate object and api name is candidate underscore underscore c so I am just copying it and I am pasting it here equals to new sorry equals to can then new and then paste the api again then parenthesis now here you will be filling values to fields so I am going to open this object moving to fields and relationships okay before that I am going here on the ui and clicking on candidates clicking on new so that I can see if there is any required field so I don't see any required field I have first name last name and other fields so I am going to fetch their api names so for first name api name is first name underscore underscore c okay so here candidate and can dot last name so last name will be available so sometimes these suggestions will be available so you can pick from here as well and I am entering 201 so this way I just provided first name and last name then writing insert can okay so one more method is created and if I run this method so candidate record will be created so I am just saving this method now here I am going to call create candidate so selecting this line clicking on execute highlighted so here I can see this candidates tab and I am just refreshing so I think we have lots of record and latest is number four so I am going to open it moving to details so here you can see first name is candidate and last name is 201 and it is created today date is available right okay so I hope you understood how we can create records through this custom object so custom object api we are using as a data type okay so I just want to request everybody those who really want to learn apics programming so you need to be consistent you need to have faith in yourself so just think like I can learn if I do practice so initially it will be difficult for you if you are not if you are from non-it background but just but just give it a try it is very simple right so in last two sessions we understood how we can create methods classes and today we are just implementing this business logic which is kind of similar for each and every method we are just changing the object apis we are changing field apis and rest of the process is same so when you will be implementing this at your own you will be having enough confidence and here we don't need to use system dot debug because whatever record we are inserting that we can verify through the UI through the application because actually record are inserting under our object and that we can check under the application right so I hope like with this motivational words you will be able to do practice consistently right okay so this way these two methods are created and I think you are able to understand it quite well so now we have one more thing that is create job application record okay okay so here we if you see job application so job application if I try to create new job application so I need two values candidate and position these are lookups these are lookups so one is lookup to candidate another is lookup to position and then we have cover letter and status right so here I'm going to search for job application so that I can pick the API so here we have the API that we can use so I'm just copying it and here I'm going to implement one more method so public static void create job application right and I hope you remember like yesterday I discussed about the naming convention so for this method I'm using first word totally small and second word first letter is capital job j capital and application a is capital right create candidate create is small and candidate c is capital then similarly create position and if you talk about class so each words first letter should be capital and if you go here so you can see the naming convention so whenever you do practice then also you should apply proper naming convention because being a sales force consultant sales force developer to apply naming convention is very much important right so you need to apply proper naming convention so you can see in my code proper naming convention is available no matter whatever method name I'm using so here insert is small account a capital with w capital con c capital and a capital of o capital so this way you will be writing naming comment you will be following the naming convention right now for create job application we need all this so I'm just copying it pasting it here I'm copying it pasting it after this right now we will be copying this API and I'm going to paste it after this then j a equals to new job application right now what we need to do j a dot now job application so we need to open it so under this job application under fields and relationship so here you can see we have position so I just need to copy this API position underscore underscore c that I'm going to use here equals to pos dot id then j a dot so candidate is available so I'm going to use can dot id so this way this is a new method which I'm creating and here first position will be created then candidate record will be created and that position and candidate that will be created will be linked with this job application automatically and here I can write status as well as new and then insert j a job application so this way I hope you can understand how we can write lengthy code so it is very easy now first we are creating insert sorry position then we are creating candidate then we are creating job application inside job application we have to look up one for position one for candidate so we are just setting the id so that newly created job application will be linked to those position and candidate records okay so I hope you are able to understand this and I'm just explaining this in very detail so I bet on this no one whether they are doing recorded videos whether they are doing paid sessions paid boot camps or any at tech company so no one will be explaining you in this detail and I am doing this for free right so just spread this word with everybody those who want to learn programming from the scratch right because I am just trying to create this platform so easy so that everybody at least can give programming a try right and there is only one way to learn programming that is consistent practice so if you do consistent practice then only you will be able to understand this right so I hope with this example you will be able to relate what is happening here I'm just saving this code now I'm going to copy this so here I'm doing a little bit change so here I'm writing SFDC developer and candidate number I am saving as 301 so that we can recognize whether new position and candidate is created or not and we'll see a job application is created or not okay so I'm just saving this now here I'm pasting the method name and I'm going to select it so that only this statement will be executed so here I'm just clicking on execute highlighted so you can see the code is executed now what we need to do we need to go to UI so here I'm doing a refresh so you can see four job applications are available I'm just refreshing it so there will be five fifth is created right now and you can see position is SFDC developer so if I open this job application I can see the data so candidate is created if I open that candidate so candidate 301 and you can see the date always verify the date whether you created this record today or it is like existing so that you can verify whether things are working fine or not then go back to job application click on SFDC developer so here also you can see record is created today right so this way we are able to create three records together and those three records are connected as well okay so I hope you are able to understand this now we need to create review record so what we need to do just after this we can add a few more steps so that review record will be created automatically so I'm going to do it for you so here I'm going to search for review so its API name is review underscore underscore C so I'm going to use it okay now we need to check what all fields we can fill for review so if I open any job application go to related so here we have review so on review we need job application and rating is required right so I just need to populate rating here so what I'm going to do first of all RV dot we need idea of that look of field so look up to job application is this so I'm just copying it and pasting it here okay then equals to and ja dot id so above job application which we are creating that job application id will go to this review so that newly created review will be related to that job application okay and here what I'm going to write RV dot rating equals to five right so I think rating is number so you can just directly write five here and then insert RV okay so this way this way position candidate job application and review all four records will be created together so now I'm going to change it so now what I need I need SFDC architect then candidate I am putting as 401 right so that we can just verify the data I'm just saving it then from here I need to run this method because I didn't change the name of that method so I'm clicking on execute highlighted it is executed moving here on the UI so I'm just moving to job application so you can see one more job application is created if I open this number six so it is having candidate six candidate six position SFDC architect and you can see it is created today it is having one rating as well by rating through review so review is created and review is created for this candidate for this position rating is five if I open this review record and go to created by so here you can see this is today's date okay so this way you can just open all the records that you are creating through this code so that you will be able to understand so this way I hope you are able to understand whatever I explained today so this was very important session and today I hope you understood how we can use s objects as a data type in apex okay so now I am just opening this platform so that you can ask questions so I'm just scrolling this chat to back so just hold on with me if you have asked any questions so I will try to answer this question whatever you have asked no need to type your questions again so I will be picking questions one by one so it will take around 30 to 40 minutes to answer all the questions so be with me have patience and I just want to thank for us for donating small amount so thank you for that and I cannot share UPI ID because this you are doing with your own wish so I don't want to share any UPI forcefully so if you wish you can just share some amount through super chat if you don't want to then that is also okay because I am not doing this like this bootcamp to have money from you right so like I don't I just want your presence and if you learn if you do certification if you get a job so that will be like return for me and just share this channel I just want support so that I can have lots of subscribers so that I can make this platform a bigger platform so I'm just taking questions now so few questions I already answered I think so someone is asking he's working as an admin with some package and yeah so first you need to learn apex then only you can go directly you can go with LWC because in LWC you will be using apex programming as well so you need to learn the backend development and then it will be easy for you to understand LWC so VV Babu is asking why we create separate class if we use anonymous window again to execute so like classes we are creating so that our code will be saved permanently right and in anonymous window we are just calling that method through one line right so without anonymous window right now we cannot run that code later on we will be using apex trigger to execute that method right so manan in class basically you need to write methods then only you can just run those methods in class you cannot write code directly so I'm just checking questions so be with me so Minakshi is asking acc.id and accid so accid I just created a variable but accid where I just used so that was through different variables so right now both are different so manan we cannot insert record using class we need to create method for that so ketan is asking can we add account id parameter while creating contact instance so I already did so for date I already explained like you can use date literals and in upcoming sessions we will be using that as well yes Ferris we can create several records that doesn't have relationship with each other so like with position and candidate you might you might have realized that so soji asking can we use cron expression we can use cron expressions so you just need to learn about that then you will be able to use those yes Sachin I will be explaining list from tomorrow like tomorrow's session will be totally dedicated for list then we'll understand set and then we'll be understanding map so sanji why cannot give the access so docs are available in view mode so you you just need to use them as is so few folks are asking like line number seven insert so insert is basically dml statement so we will be understanding dml in detail later on so right now what you can understand dml statements are basically for data manipulation purpose so if you want to insert update delete undelete any record so those statements are basically known as insert statement sorry dml statement so right now we are using one dml statement that is insert right so if you are inserting a record so that record will be available under your application so that's why we are not using system dot debug because we can check the like results on the UI Rohit is asking to teach me in Hindi so Rohit actually this bootcamp is for whole world people from outside India also watching and like people are from south also they don't know Hindi properly so that's why I'm teaching in English only and after joining any company you will be working and you will be like interacting with your clients and team in English so I'm just using very simple English I don't know I'm not expert in English I I just know basic English and that I'm using right and maybe after the end of this bootcamp so I can have separate bootcamp for the Hindi audience that I can do and as MIA suggested you can just watch this video slowly so that you can understand and you can implement yes sauzi apex is case insensitive right so someone is asking to tell apex testing parallelly so right now I cannot explain apex testing so first we'll complete apex basics then we'll do trigger and then I will tell you how we can do apex testing yes I will I will explain apex testing but first let me create a base so just go with me I know how to teach you just have to learn after the bootcamp you will be having enough confidence with you don't no need to worry thank you akshay that's what I was discussing like after spending money you won't be getting such a session so please share the word with people so that they can also join and get benefited so puja I already explained what is the use of static in yesterday's session void I already explained like it is return type and return keyword basically we use when we want to throw or return a value from one method to another okay Sachin I will try to increase the limit so I think it is by default set by youtube so I will try if I can increase the character limit beyond 200 so Sam is asking if the API static method then we can access directly how we get to know I didn't get your question can you a little bit elaborate thank you sashi for appreciating so saaji you are asking can we use return keyword in s object so return keyword basically we are using inside the method so it is related to method if one method want to return any value so if you want to return any s object then you can use that s object as a return type so we'll be using that later on right yes so satya you want if you want to calculate age from date of birth so you can just subtract date of birth from today system dot today so system dot today minus what is whatever is your date of birth so you will be having a date sorry your age thank you samir for appreciating my efforts thank you aparna for me like considering me or godfather so I'm just trying to help community as much as I can so if you if you are considering me a good person so I'm happy and obliged thank you Vishal for appreciating and I am happy like you are learning through my efforts yes marry you need to study a lot so like make a proper schedule after this session at least you need to do one hour practice then you will be able to understand thank you mayur for appreciating yes manos after attending map session you won't be saying this because I will be explaining map in very detail so I will take one hour to explain map only so you will be able to understand yes marry so I just shared that information with the people like there is some people who are sending wrong email so just avoid that thank you vikash for appreciating so so manos don't worry about map we will discuss yes sam for static method we will not create instance so that is helpful yes reka I will be explaining other dml operations so if you see the session tracker so you will get the answer of your question so satya if you are getting added so just just follow the telegram group so I'm just sharing the link with you you can just join that group so that if you face any difficulty you can just join that group and I have very good people in that group they are helping each other so puja for that I will try to have deployment related sessions so but they will be after the development related sessions so practice sheet is available in the description of this video so I am just sharing that link as well so this is the link of exercise sheet that I'm going to share with you so mayur we cannot create sandbox in dev org it is not allowed thank you riveti for appreciating my efforts so just a request please help me to reach 100k subscribers this is the only expectations of mine from you so just share this channel with all the whatsapp groups telegram groups and ask people to join and I already told you I am planning to start cyber security boot camps soon so it will be somewhere in april so those who are cyber security enthusiasts just share that knowledge with them and have them connected with the platform so that they will be notified with that and try to link college students as well so I know you are connected with your colleges because if you are working in some company or fresher so you are alumni of your college so if you are connected with your juniors so just share this link with them as well so because cyber security is common for everyone whether they are students learning they are fresher experience candidate so everybody can be benefited so if you scroll down to bottom so this this is not admin it is both admin as well as development so if you scroll down you will find a date 32 33 34 those those are having development related exercises okay so if you have more questions so you can go ahead and ask otherwise I will be ending this session so I think we had a good time today and I hope this session was fruitful for you so just share the word with everybody so that more people can be benefited okay guys so thank you so much for joining today's session I appreciate your time thank you see you tomorrow