 Hello friends. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So in this video, I'm going to demonstrate how you can apply profile chat while creating validation rule in Salesforce. Before starting, if you want to watch Salesforce training videos, you can search my name Sanjay Gupta on YouTube and you can follow my YouTube channel here, various playlists related to Salesforce and other programming languages are available. So now I'm going to create validation rule on account object. So I opened account, sorry, object manager and open account object. So here you can see at the bottom validation rule option is available. So now I'm going to create new validation rule. So, so here I'm going to provide rule name, so check annual revenue. So this is the rule name. So I'm going to fill the description. So if profile is other than and sorry, system administrator, then annual revenue should be populated. So this is our requirement. So only system admin if system admin doesn't fill annual revenue while creating or updating the account record, then error should not be thrown. Rest of the profile user will get error if they don't fill annual revenue while creating or updating the account record. So now I need to add system admin profile chat while creating this validation rule. So I'm putting and then to apply profile check, I need to write $profile.name then not equals to and inside single quotes, I am writing system administrator. So if profile name is not equals to system admin and is blank. Now here I'm going to insert a field that is annual revenue. So if profile name is not equal to system administrator and annual revenue is blank, then this validation rule will fire. So we can check the syntax, whether it is correct or not. So no errors found, it means syntax is correct. So this way you can add the profile check in validation rule. Then here you can put the message, error message like please fill annual revenue and error location like it is top of the page. Now I'm going to save this. So it is created now. I'm going to open this application that is sales. So here first I'm going to show you this user detail. So I'm opening it in new tab. So this user is open now I'm clicking on user details. So this users profile is system administrator. So here at right hand side you can see this users profile is system administrator. Now I'm going to edit this record. So let's say I'm choosing any other record. So this one I'm choosing and I'm going to update this. So here you can see annual revenue is blank. So I'm going to edit this and I'm putting only waiting. So I'm updating this record and annual revenue is blank. Here you can see and still it will not throw any error because this users profile is system administrator. So if profile is equals to system admin then that validation rule will not fire. If your profile is other than system admin then this validation rule will fire. So now I'm opening another browser window. So here you can see I'm logged in as another user whose name is Vikas. So I'm opening this users record so that we can see what profile this user has. So I'm opening the users detail. So here you will see that this users profile is not system admin. So this users profile is standard user. Now I'm going to open a countercard going to details. Here you can see annual revenue is already populated. So I'm going to edit this and I'm going to remove this. And let's say here I am putting rating and annual revenue is blank. Now I'm trying to click on save. So here you can see please fill annual revenue. This error occurs because a validation rule is working. So our validation rule says if profile name is other than system admin and you are putting annual revenue as blank. So this validation rule will fire. So this way you can put profile name check while creating validation rule. And if you want that this validation rule should work for system admin and should not work for other profiles then you can remove this not equal and you can put double equals two or equals to sign here. So this way you can implement the profile check and validation rule. So I hope you understood how you can implement validation rules with the profile check. So I hope you understood whatever I demonstrated in this video. If you want to watch more Salesforce training videos, you can search my name Sanjay Gupta on YouTube. And here various playlist related to Salesforce and other programming languages are available. So you can watch them. Thank you for watching this video.