 Hello everyone, I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate a scenario related to record trigger flow. So let's understand the requirement first. So in this video, I'm going to demonstrate what happens when record trigger flow fails. So I will be demonstrating this with the help of a scenario. So scenario is like we need to create a contact related to account upon account creation, right? So knowingly, I will be implementing this flow in such a way so that it breaks from the UI. And then we'll see what happens and how we can fix that. So here in the developer edition org, I selected new flow and I'm selecting record trigger flow. So object I'm selecting as account, then trigger the flow when a record is created. Then if you want to put any conditions, so you can. So let's say I'm putting condition as active equals yes. And I want to create a related record. So that's why I'm selecting actions and related record and clicking on done. Now through this plus, I am just selecting create record. So I need to create a contact. So I wrote label as create contact. One contact I need to create, then use separate resources and literal values. Then here I need to select object as contact. And here I'm just filling first name. Now in previous videos, I also told like whenever you create any record trigger flow and that record trigger flow will be triggered through any record that you are creating, updating, or deleting. So that records information will always be available in this dollar record variable. So from here, I'm just fetching the account name. So whenever any account record is being created, so that account record whole information will be available in this dollar record. So through that account name, I'm setting in the first name. Now on contact, last name is a required field. And that I'm not setting here so that our flow will break from the UI. So I just clicked done, save. So let's say what happens when record trigger flow fails. So it is saved. I'm activating it. Now I'm moving here. And I will be creating a new account. So I clicked on new. And here I'm writing ACC 3304. And I need to set active as yes. And I'm clicking on save. So here you can see some error message available. So it is saying we can't save this record because what happens when record trigger flow fails. So this record trigger flow is failed. So it is saying give your Salesforce admin these details. Then required field missing. Why it failed because required field is missing and which failed last name. So this way you will see the complete error message. Now the user record through which you created this flow so that user will receive an email as well. So here you can see an email is available if I open this. So here also you can see the same error message. Right. And if you scroll down, so it will show it here as well failed to create a record and required field is missing. So this way whenever you create any record trigger flow and it fails. So you will receive error from the UI like this as well as you will receive an email. Now if I fix this. So if I set last name. So I'm setting last name as well as account name. So both first name and last name are equals to account name. And I'm clicking on done. Save as, so I'm creating a new version and clicking on save and activate. Now if I try to create new account, so it will be created. So even if I click on save again on this record only it will be saved and new contact will be created related to this account. So you can see account 3304 is created and okay. So contact is created but it is not linked with the account. So if I go to contact, so you will see ACC 3304 first name and last name. So here you can see, but it is not linked. So the reason is I didn't populate it that lookup field. So this is one more thing that you need to do. You need to fill this account ID that is lookup field API with the account record ID. So it is important if you don't provide account ID into this lookup field so your newly created contact won't be linked with your account though it will be created but it won't be linked as we saw in the demo. So I'm just activating it. Now if I try to create any account so you will see the contact will be linked automatically. So I am going to set active as yes. Looking on save. So now you will see a contact is related and this opportunity is being created because I created one more record trigger flow for the previous demonstration and that's why it is connected here.