 Hello friends, I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to cover the topic that is lookup filter. So we can have lookup filters and lookup relationship as well as a master detail relationship. So I'm going to explain both. If you want to follow Salesforce related video series, you can search me on YouTube by my name. So watch those. Now, I'm searching for the custom objects that I've already created. So I'm going to search for employee objects. So it is here. And you can see it is having both lookup relationship as well as master detail relationship. So first I'm going to open this field as account that is lookup relationship. And if I scroll it down, so here you can see lookup filter option is available. And right now no lookup filter is defined. So I'm clicking on edit, clicking on show filter settings. And here you can see certain options like first is filter criteria, then filter type and then lookup filter window text and then active. So first I'm going to set filter criteria. So if I click here, so I will be having employee account and user. So I can set condition based on three objects. I can choose user as condition I can choose account as condition I can choose employee as condition. So I'm choosing account. And for account I'm choosing it's time. And then you can choose any operator. So I'm choosing equals then here two options are available field and value. If I choose field, sorry value, then I can choose a particular value. So it is a pick list. So all these values are available. So I'm choosing customer channel. If you're comparing a text, then you can type anything directly here. If you choose field, it means you need to compare this field with another field. Right. So it depends upon the requirement of the scenario. So right now I'm comparing account type that should be equals to customer channel. So lookup will lookup filter will show only those records where type is equals to customer channel. Now we have two options filter type as required and optional. So required says the user entered value must match filter criteria. So if you choose this option, then the records which will match with this filter criteria will be displayed. Otherwise, this error message will be displayed and you can also modify this message. So we have second option as optional. So if you choose this option, then it says the user can remove the filter or enter values that don't match criteria. So we have both. First it will show the values which are matched with filter criteria. Secondly, we can remove those values and we can search as per our own criteria. So I will demonstrate you both the things also you can see here and is available so you can implement more than one conditions in the filter criteria. If you want to add the logic, like if you have two, three, four conditions so you can customize your filter filter criteria as per this. Right. So now it is already active. I'm saving it. So we implemented look up filter. So here you can see the condition account type should be equals to this. So I'm going to employ record. So here you can see I have opened employee. So if I click on this record. So here we have look up for this account. So I'm editing it clicking on it. So here you can see it is showing customer channel. Now, let me open account also so that we can identify the reports where account type is customer channel. So I'm going to do all accounts. So here you can see for these two, which are starting with e for one we have customer. So the account type as customer direct and for another one we have customer type. So the account type is customer channel. So let me search it. If I click here. So you can see it is showing only one which is related to customer channel. Let me search for any other for the endpoint and grand hotels and resort. So if we search for the account name which are starting from G. So it should display only one. So let's try it out. So you can see it is showing only one account record. Their type is customer channel. So this way, this look up filter works. Now, again, I'm editing and selecting the option as optional. And saving this and refreshing this page, clicking on look up filter icon. Now, if I search for GS risk, so it will show only one record, but here you can notice that results are narrowed down by criteria set by the administrator, but it is showing this options show all results. So if we click on this, it will show all the records, whether it is matching criteria or not. So this way you can have both options available. You can make local filter required as well as optional. So I hope you understood how we can implement look up filters and look up relationship. Similarly, we can also implement this in master detailing relationship. So if I open this in edit mode. So same options you will see here like filter criteria, feel types and active. So you can set the condition here. So now we can have opportunity because this feels parent is opportunity. So we can have suppose stays equals value prospecting. Right. And if you choose required, so accordingly it will work. If you choose optional accordingly it will work. And you can click on save. So this way we can set look up filter in master detail relationship also. So I hope you have understood how we can implement look up filters in both look up relationship and master detail relationship. If you want to follow more Salesforce related videos, you can search my YouTube by my name. Thank you for watching this video.