 Hello friends, I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I am going to demonstrate how you can call APEX class in vocable method to auto launch flow in Salesforce. Before starting, if you go to description of this video, you will find various links related to Salesforce playlist. So there are various videos are available so you can follow them. Now, starting my demonstration. So firstly, I implemented a class that is count action and it is having one invocable method. So this is annotation, which is written before the method. So if you write iterate invocable method annotation before a particular method so that method can be called to lightning flow or process builder. So this method will be called it is expecting a parameter as list of ID. So those values will be stored in this IDs variable. Then here list of string is list of string type variable is created. Then here through this query, I'm patching name of accounts for those whose IDs available in this list of ID. Then iterating this list of account and adding name of account into this string and after completion of this loop, the account name list will be returned through this method. So if you want to return any value back to the flow that you can do and if you don't want to return any value and you want to perform any operation in this APEX only, that is also possible. But in case of process builder, we can only perform the operation APEX classes. We cannot return values back to the process builder. So this is an advantage while using these classes or invocable method into lightning flow that we can return values as well. So now after this explanation, I'm going to create a flow. So while you are going to create a flow, so remember that you need to create auto launch flow for this. So in my another video, I'm also going to demonstrate how you can all APEX class through stream flow. So that is available in the playlist. So you can watch that as well. So here you can see I have created a variable record ID. So account record ID will be received in this variable. It is of text and available for input. Then from element and dragging and dropping action, clicking on type APEX action and here you can see account action class is available. So you can provide any label that is suitable. Then here you can see we need to set the input values. So this IDs is available in our class method that is update account name or here I can write return accounting because we are returning account names. So I'm saving this. So hey, I have updated the method name. Now if I go here. So whenever you update your APEX class just refresh your flow so that update updated values or updation will be available here. So now all APEX class. So this is label. Now I need to pass the input. So I'm passing the record ID from here and the return value we can manually assign into variables. So output values will be stored in the variables. So I'm going to create one variable. Its name is return value. It is of type text and I'm clicking on done, done, and I'm connecting this right. So right now I'm just saving this and from here only I'm going to debug this auto long through so that manually I can pass the record ID of account record and I can check the process whether it is working or not. So I'm fetching this account record ID. So you can see name of this account is ACC space test. So I'm passing this record ID and executing. So here right inside you can see account action APEX is called input was passed as this record ID and return value is containing ACC space test as accounting. So you can use this return value that is stored in the variable return value further if you want to apply any calculation. So right now I demonstrated you by debugging this auto launch flow. But if you want to call it automatically so you can you can call this auto launch flow through any process with the help of process builder. So whenever you will be creating or updating any account report so that process builder will be executing that will be passing the account record ID to this auto launch flow and this auto launch flow will be calling the APEX class invocable method and accordingly this will execute. So this way I hope you understood how we can call APEX class invocable methods through auto launch flow and if you want to learn how we can call auto launch flow through process builder so that video is also available in that playlist. So go to description and you will find various links of Salesforce related videos playlist. So follow them and learn Salesforce. Thank you for watching this video.