 Hello everyone. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate a scenario based on record trigger flow. Let's understand the requirement that I'm going to demonstrate so that you can learn a new scenario based on record trigger flow. So in this scenario, we will try how we can update parent records while child record is created. So the use case is whenever a case is created, then populate case number in latest case number field on the account record. So for example, we have an account record and whenever any new case is created under that account. So we need to populate the latest case number on that account in this latest case number field. So how we will be performing this. So first of all, I need to go to object manager and I'm going to create one new field on account object. So I clicked on fields and relationships and then clicked on new, then I'm going to select the text as a data type clicked on next. So here I'm creating latest case number and let's say length is 100 clicking on next. So it will be available to all the profiles clicking on next it will be available on the page layouts and I'm clicking on save. So here our latest case number field is created right now after creation of this field, I can go and create a flow. So I'm just clicking on new flow from here I'm selecting report triggered flow and clicking on create. So the object I need to select as case because case will be created and the trigger the flow when a record is created. So we need to set the entry criteria so from here I'm selecting this end condition and the criteria will be like on case we have a look up that is account ID. If it is not null, then only we need to go forward, because if cases linked with an account then only we need to populate the case number on account latest case number field. So we are creating a case and if it is not related to any account. So in that case we don't need to proceed further. So after setting this condition, we need to select actions and related records options, because we are creating case and we will be updating the account record. So I'm clicking on done. As you can see, we have various options. If we click on the plus. So from here I'm going to select the update record option. So we need to update the account record. Now, from these three options, I'm going to select the third option. So we need to specify conditions to specify record and set fields individually. So from here I'm going to select account because we need to update the account. Now, we need to find that particular account which we want to update. So if account ID is equals to now whenever you create any case and this record trigger flow will run. So the case information will be available in the global variable that is known as dollar record. So through this dollar record global variable, you can fetch the account ID. So if the account ID that is available on the case record matches with the account through this ID, it means we need to update that account record. So here we can have this latest case number field and from here we can provide record dot case number. So again, the newly created case fields information will be available in this global variable that is dollar record. So through that we are fetching the case number and this case number we are signing into this latest case number field that we created on the account record. Now I clicked on done. So this way this flow is implemented like this flow will trigger when case record is created that is child for account. So upon creation of that case account field will be updated. So that's why it will be known as parent to child field update. Sorry, child to parent field update because flow is triggered through child and we are updating the parent. So I'm just clicking on save. So update latest case number on account. I'm clicking on save. Now I'm clicking on activate. If I go to the UI. So I'm going to create new case under account. So here you can see if I open any account record. So on this account record latest case number field is available. It is blank right now and there is only one case which is having number as 1030 right now I'm going to create new case. So I'm setting the required fields. Account name is populated. So I'm clicking on save. So new cases created and its number is one zero double three. If I go to the details of account. And if I do a refresh. Okay, so it is not available here. Let's check the flow. So if it is not working fine so what you can do you can just debug your flow so that you can check whether it is working fine or not so I'm clicking on debug. You need to search the case and click on run. So now you can open this. Okay, so here you can see ideas available but latest case number equals to null. So in this flow latest case number is null. Okay, so I think this part was not saved properly. This is available so I just need to click on save as and activate again. So again, I'm going to related list and trying to create one more case. So the latest case number is one zero three four let's check the field. Yeah, this time you can see latest case number is available that is one zero three four. Now, what will happen if I create one more case. The existing case number will be overwritten and the new case number will be available on the account. So that field will always be having the newly created case on that account. So now cases created as one zero three five. If I go to details so you can see latest case number is one zero three five. So this way, with this flow, I hope you understood how we can update parent records whenever child record is created.