 Hello friends. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate you how you can implement lookup filters and lookup and master detailed relationships in Salesforce Lightning. If you want to follow Salesforce related video series, you can search my name on YouTube and follow my YouTube channel. Now coming on to the topic. So first let me open my university app where all the apps and objects are available. So in my previous video, I demonstrated you how we can create lookup and master detailed relationship. And while creating those relationship fields, I told that you will see lookup filters in my another video. So in this video, I'm going to tell you about lookup filters. So in that video I created lookup relationship field on books and master detailed relationship field on book histories. So I'm opening book record and here at the bottom, you will see this lookup relationship field. So here it is showing available records of students. So now if you want to apply some filters so that selected record will be available here. So that we can do with the help of lookup filters. So first time opening book object and inside book object, you will see a lookup relationship field that is related to student. And if I click on edit, so at the bottom, you will see lookup filter. So in this lookup filter, you can set particular filter criteria. So let's say I'm setting country equals to value as India. So I want to populate only those records where country is equals to India. And if you want to apply multiple criteria, you can choose these other rows. And you can also add filter logic like this example one and two or three. So this way you can implement multiple filter criteria. Then we have two options required and optional. If you want this filter criteria to be required, you can select this. If you want to make it optional. Then the user can remove the filter and enter values that don't match criteria. Right? So you can choose anyone of the option. If you want to show any lookup into text, you can write here. And to make it active, you can check the checkbox. So right now I'm making filter type as required and clicking on save. So we applied a filter criteria. Here it is student country equals India. So now moving to that. So first let me open all student records. So I'm clicking on list view, selecting all. So it is showing all available records. So two records are in country India and one is Spain. So now moving to book creating new record. So if I click here, it will show only two records. Martin and Sanjay, because these two records are related to India only. If I search for the cars, it will show no available records. No result for the Carson student. Right? So if I said Sanjay, so it will save it correctly. So this way you can apply lookup filters in both lookup and master detail relationship. So here I applied lookup filter and lookup relationship field. And we have master detailed relationship field on book histories. So now I'm opening that and you will see the lookup filter is same in book histories also for master detail. So here master detail is this. So I'm opening book field clicking on edit. So if I expand this, you can see everything is same as lookup relationship field. You need to set the filter criteria here. Then you can choose required and optional. Then you can fill the lookup window text and you can make it active and click on save. So this way you can apply lookup filters in both lookup relationship as well as in master detail relationships in Salesforce. So I hope you understood how we can implement lookup filters. If you want to watch more Salesforce related videos, you can search me on YouTube by my name. Keep following. Thank you for watching this video.