There will be times, we all need to use AND operator in the validation rule in Salesforce. And here, I will explain how to use AND operator in the validation rule in Salesforce. We will also discuss, how to apply AND operator in the validation rule in Salesforce.
Recently, I was working in Salesforce, where we got a requirement to use AND operator in the validation rule in Salesforce. So, in this blog, I will also explain, how to use AND operator in the validation rule in Salesforce.
So, we will cover these topics in this Salesforce tutorial.
- What is AND operator in Salesforce?
- How to use AND operator in validation rule in Salesforce
- How to use AND operator in validation rule in Salesforce lightning
- How to use AND operator in validation rule in Salesforce Classic
- How to apply AND operator in validation rule in Salesforce
- How to operate AND operator in validation rule in Salesforce
What is AND operator in Salesforce?
The AND operator is used to estimate if the two values are both true. The And operator is different from the Logical function And.
If all the values are true, the And operator returns the True response. If one or more values are false, the And operator returns a False response.
Now let’s understand the add operation in salesforce with the help of an example.
For example, there is an Aufderhar-Predovic USA-based company that applies AND operator in the validation rule, and the validation rule is applied in the form that is filled out by the company employees.
So, with this, we understand What is AND operator in salesforce. Further, we will learn how to use AND operator in validation rule in salesforce.
Also, check Validation Rule for Name Field in Salesforce
How to use AND operator in validation rule in Salesforce
AND operator is an operator with returns the True values if every value is true. If one or many values are false it returns a False value.
So, if you want to learn how to use AND operator in the validation rule follow these steps:-
- Go to the gear icon, click on the setup, and then click on the Object Manager which is present behind the Home tab in the nav bar.
- After clicking on the object manager, the object manager page is open inside this page there are so many objects. Select one of the objects on which you are applying the validation rule by using AND operator.
- After clicking on the object, now click on the validation rule option that is present in the left sidebar.
- Click on New after that fill the Validation rule edit information and then fill the Error formula condition in which we are using AND operator then describe the error message after that and click on save.
- After saving you can see that the object validation rule is created you can edit the information if you want just simply click on the edit option.
Now, let’s move ahead and see how to use AND operator in the validation rule in Salesforce. We will explore both the salesforce experiences: Salesforce lightning and Salesforce Classic.
Read How to create list view in community Salesforce
How to use AND operator in validation rule in Salesforce lightning
Salesforce Lightning is a modern view of the salesforce platform that is fast, easy, and filled with a wide variety of options.
Follow the below steps on how to use AND operator in the validation rule in salesforce lightning:-
Step-1: First, go to the setup and then click on the object manager which is present beside the home tab.

Step-2: After clicking on the object manager, the object manager page is open inside this page there are so many objects. Here we are selecting the Opportunity object on which we are applying the validation rule by using AND operator.

Step-3: After clicking on the opportunity object, now click on the validation rule option that is present in the left sidebar.

Step-4: After clicking on the validation rules option, now click on the new option that is present on the right side.

Step-5: After clicking on New the opportunity validation rule page is open inside this page there is the Validation rule edit, fill the Validation rule edit information. Firstly fill the rule name and description.

Step-6: After filling the Validation rule information, now fill the information of the error condition formula. Here we are using AND operator and we select the ISBLANK function and then click on the insert field after that click on check syntax.
After clicking on check syntax it shows no error found. So we can move forward and do the next step.

Step-7: After filling the information of the error condition formula, now give the description of the error message and after that click on the save option.

Step-8: After clicking on the save option, the opportunity validation rule page is open and you can see the complete opportunity validation rule detail.

Step-9: Again click on the opportunity object, and then select the New opportunity and this opportunity object is present on the nav bar.

Step-10: Now fill the information related to the opportunity, here you can see that we can not fill the order number and tracking number field, and click on the save option the error message occurs. Review the errors on this page.

This is how we understand the use of AND operator in the validation rule in salesforce lightning.
Read How to Add Tab on Activity Tab in Salesforce
How to use AND operator in validation rule in Salesforce Classic
Salesforce classic is the traditional user experience of salesforce and before the salesforce lightning was introduced, it was the only salesforce experience.
Follow the below steps on how to use AND operator in the validation rule in salesforce classic:-
Step-1: First, go to the setup that is present in the top right corner of the salesforce classic.
On the left-hand sidebar there is the customize tab under the build app, click on the drop-down menu of customize then select the account object that is present under customize.
Under the Account object there is a validation rule option, click on the validation rules.

Step-3: After clicking on the validation rule, the Account validation rule page is open then click on the new option.

Step-4: After clicking on the new option, The new account validation rule page opens in which we can fill the information, firstly fill the rule name and then give the description and then move forward.
Here we are applying the validation rule on the Account Number and Account site.

Step-5: After filling the Validation rule information, now fill the information of the error condition formula. Here we are using AND operator and we select the ISBLANK function and then click on the insert field and after that click on check syntax.
After clicking on check syntax it shows no error found. So we can move forward and do the next step.

Step-6: After filling the information of the error condition formula, now give the description of the error message and after that click on the save option.

Step-7: After clicking on the save option, the account validation rule page is open and you can see the complete validation rule detail.

Step-8: Again click on the account object, and then select the New account and this account object is present on the nav bar.
Now fill the information related to the account, here we can see fill the Account Name as USAtheron42 and also fill the Parent account.
And you can see that we can not fill the Account number and account site, click on the save option the error message occurs. Review the errors on this page.

So, with this, we understand how to use AND operator in the validation rule in salesforce classic.
Read How to Merge Accounts in Salesforce
How to apply AND operator in validation rule in Salesforce
And operator returns a False response If one or more values are false and the And operator returns the True response If all the values are true.
Follow the below steps on how to apply AND operator in the validation rule in salesforce:-
Step-1: First, go to the setup and then click on the object manager which is present beside the home tab.

Step-2: After clicking on the object manager, the object manager page is open inside this page there are so many objects. Here we are selecting the USA Employee object on which we are applying the validation rule by using AND operator.

Step-3: After clicking on the USA Employee object, now click on the validation rule option that is present in the left sidebar.

Step-4: After clicking on the validation rules option, now click on the new option that is present on the right side.

Step-5: After clicking on New the USA Employee validation rule page is open inside this page there is the Validation rule edit, fill in the Validation rule edit information. Firstly fill in the rule name and description.

Step-6: After filling the Validation rule information, now fill the information of the error condition formula. Here we are using AND operator and we select the ISBLANK and ISNEW functions and then click on the insert field after that click on check syntax.
After clicking on check syntax it shows no error found. So we can move forward and do the next step.

Step-7: After filling the information of the error condition formula, now give the description of the error message and after that click on the save option.

Step-8: After clicking on the save option, the USA Employee validation rule page is open and you can see the complete USA Employee validation rule detail.

Step-9: Again click on the USA Employee object, and then select the New USA Employee and this opportunity object is present on the nav bar.

Step-10: Now fill the information related to the USA Employeee, here you can see that we can not fill the Employeee email field, and click on the save option the error message occurs. Review the errors on this page.

With this, we have learned how to apply AND operator in the validation rule in salesforce.
Read How to Share a Report in Salesforce
How to operate AND operator in validation rule in Salesforce
Here we see how to operate AND operator in the validation rule in salesforce. So, if you want to learn how to operate AND operator in the validation rule follow these steps:-
Step-1: First, go to the setup and then click on the object manager which is present beside the home tab.

Step-2: After clicking on the object manager, the object manager page is open inside this page there are so many objects. Here we are selecting the Account object on which we are applying the validation rule by using AND operator.

Step-3: After clicking on the Account object, now click on the validation rule option that is present in the left sidebar.

Step-4: After clicking on the validation rules option, now click on the new option that is present on the right side.
After clicking on New the Account validation rule page is open inside this page there is the Validation rule edit, fill the Validation rule edit information. Firstly fill the rule name and description.

Step-5: After filling in the Validation rule information, now fill in the information of the error condition formula. Here we are using AND operator and selecting the ISBLANK and ISNUMBER functions and then clicking on the insert field after that click on check syntax.
After clicking on check syntax it shows no error found. So we can move forward and do the next step.

Step-6: After filling the information of the error condition formula, now give the description of the error message and after that click on the save option.

Step-7: After clicking on the save option, the Account validation rule page is open and you can see the complete Account validation rule detail.

Step-8: Again click on the Account object, and then select the + New Account and this Account object is present on the nav bar.

Step-9: Now fill in the information related to the Account, here you can see that we fill the Account number field as an alphabetical manner and click on the save option the error message occurs.

So, with this, we understand how to operate AND operator in validation rule in salesforce.
Conclusion
In this tutorial, we have learned how to use AND operator in the validation rule in salesforce, and also we have covered how to append ANd operator in the validation rule in salesforce. This can be performed on both salesforce lightning and salesforce classic.
- What is AND operator in Salesforce?
- How to use AND operator in validation rule in Salesforce
- How to use AND operator in validation rule in Salesforce lightning
- How to use AND operator in validation rule in Salesforce Classic
- How to apply AND operator in validation rule in Salesforce
- How to operate AND operator in validation rule in Salesforce
You may also like the following salesforce tutorials:
- How to delete custom objects in salesforce
- Create a Custom Object in Salesforce
- How to use schema builder in salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.