 Hello friends. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate how to apply permission set jack in validation rule or how you can bypass validation rule for particular users using permission set. So before starting, if you want to follow Salesforce training videos, you can search my name Sanjay Gupta on YouTube. And on my channel in playlist, you can find Salesforce and other programming related videos. So do follow them. So now, first of all, to apply permission set check in validation rule, you need to create a permission set and you need to assign that to a particular user so that you can use that in validation to bypass or checking the permission set. So here you can see I created a permission set whose name is admin permissions and I'm copying this name. Now I'm going to open this and I'm going to assign this permission set to a particular user. So I'm clicking on manage assignments, clicking on add assignment, and I'm picking this user Sanjay Gupta and clicking on assign. So here you can see this permission set is assigned on this user only. I'm clicking on done. So it is assigned. Now if I open user record, so let's say I'm opening this user's record. So here you can see permission set is assigned here. Right. So after creating permission set and assigning that permission set to a particular user, then the second step will be to create custom permission. So you can search custom permissions in setup. Now create new custom permission. Now here you need to remember that the name of custom permissions should be equivalent to your permission set. So here permission set name is admin permissions. So you can copy this. And you can put it here. So we cannot use permission set directly in validation rule. We can use their permission custom permissions only. That's why we are creating this. So I'm clicking on save. So this way this custom permission is created. Now we need to assign this custom permission to permission set. So if you open permission set, then here you will find this custom permissions option. So you can click here and here you can click on edit. And you can assign this available custom permission. So now it is enabled and you can click on save. So here it is available. So what I did first I created custom permission set. Then I assigned that permission set to that user for which I want to bypass the validation rule. Then I created a custom permission. Then I assigned that custom permission to the permission set. Now I can create a validation rule and I can use this permission to bypass that validation rule for a particular user. So now you can see I am on account object. I am going to create a validation rule. So here let's say rule name is check annual revenue and in description I am writing if user is having admission, sorry admin permission set assigned then this validation will not fire. Now here I need to implement the formula. So I am putting end condition inside and now I am putting dollar permission dot and here I need to put that custom permission. So I applied this. I am checking one more thing like is blank and I am checking a particular field that is annual revenue. So if a particular user is having this permission set assigned and annual revenue is blank, I am putting not also here. So if a particular user is assigned this permission set and annual revenue is blank then this validation rule will not fire. If a user is not having this permission set assigned and annual revenue is blank then this validation rule will fire. So the user who will be having admin permission set assigned for that this validation rule will bypass. So I am going to check syntax. So here we need to put ABI name. So remember that you need to put ABI name of the custom permission here. So it looks like you are applying the permission set here but actually we are applying the custom permission that we created here. Now I am providing error message so please fill annual revenue and error will be shown on the top of the page. Now I am clicking on save. So this validation rule is created and if your user is not having this permission set assigned and annual revenue is blank then this validation rule will fire otherwise it will be bypassed. So I hope you understood how we can bypass a particular user to validation rule. So now I am going to open a count record. So first let's see with which user I am logged in. So I am logged in at Sanjay Bhukta and on this user I assigned the permission set. So here I am opening the record and you will see here this validation rule will bypass. So here you can see annual revenue is blank and let's say I am modifying this field and I am clicking on save. So no error will occur because this user is having that permission set assigned and through that permission the validation rule is bypassing. Now I am moving to another window where I am assigned as another user. So I am opening this user. So I am going to open this user's record so that we can verify whether permission set is assigned here or not. So I am clicking on user details. So here if I scroll it down so you can see here no permission set is assigned. Now I am moving to here and I am going to open a count record and I will try to put annual revenue blank and try to edit this record. So let's say I am putting it as blank and trying to save it. So here you can see it is showing that please fill annual revenue. This is because this user is not having that permission set assigned. So this way if a particular user is having that permission set assigned along with the custom permission then validation rule will not fire. It means validation rule is bypassing. So this way I hope you understood how we can apply permission set check. So you cannot apply permission set check directly in the validation rule. You need to create custom permission so this is important and this is a very good question that is asked in various interviews. So you need to remember that we can apply profile check directly but for applying permission set check we need to create custom permission then only we can apply it on validation rule. And with the help of this we can also bypass validation rules for a particular user or group of users. So in this demonstration I created this permission set. So whoever user is having this permission set they will be bypassed by that validation rule. So this way I hope you understood all the things that I demonstrated in this video. If you want to watch more Salesforce training videos you can search my name Sanjay Gupta on YouTube. And you can follow various playlist related to Salesforce and other programming languages on my channel. Thank you for watching this video.