Validation Rule | Online Help - Zoho CRM

Working with Validation Rules

Creating and keeping high-quality data is difficult, but it's even harder to identify and fix a dataset full of mistakes.

Faulty CRM data can lead to negative consequences for a company, including impeding operations, generating unreliable reports, and demanding that users manually verify each record. One common cause of these errors is manual data input. Whether due to lapses in attention or accidental keystrokes, mistakes are bound to happen when entering data into a form. To reduce these errors, CRM systems have validation rules in place to notify users of mistakes and block incorrect data from being entered.

Validation rules can be used to handle situations like the following:
  1. Preventing a form from being saved if a social security number doesn't contain nine characters.
  2. Alerting an agent when a traveler above the age of 40 is added to a physically challenging trip.
  3. Stopping a sales representative from offering a discount when a company has not purchased a minimum number of user licenses.
  4. Ensuring an IBAN number matches the specified format.
Availability
Users need Module Customization profile permission to create validation rules.


Basics of validation rules

  1. Validation rules in Zoho CRM are set up for specific fields, such as the Discount field in a deal's record. If a user inputs an invalid value and attempts to save the record, the CRM will display an error message or alert. Please note that the alert option shown below is being released in a phased manner and may not be available in your account.
  2. Validation rules determine if an entry is valid by comparing the input with the criteria or function set for the rule.
  3. Validation rules are layout-specific, meaning it's possible to set up different validation rules for the same field on different layouts.

Configuration options in validation rules

Options are available at each stage of the configuration flow when setting up a validation rule. The choices made will vary depending on the specific use case. Let's look at some of these options.

Validation preference

Let's say you have a company policy that prohibits discounts that exceed 15%, and that sales reps are encouraged to avoid offering discounts over 10%.

In this scenario, you can set validation rules that completely disallow values above 15% and allow values above 10%, while also displaying a warning for sales reps that discounts above 10% are not ideal.

You can manage situations like this by setting the validation preference as follows:
  1. Stop with error (which prevents the saving of the record)
  2. Allow by alert (which allows the saving of the record after getting confirmation from the user)
The stop with error option prevents users from saving changes to records when a field contains an invalid value.
The allow by alert option allows users to save changes made to records but displays a warning and requires confirmation in order to complete the changes.

Error location

You can also choose where error messages are displayed on the form. You can choose:
  1. On primary field to display the error message right next to the field.
  2. Top of page to display it at the top of the form.
In most cases, the values users enter into different form fields are not interdependent. For this reason, if there's a validation error for any given field, it's best to display the error near that specific field. This enables users to easily identify and correct any input errors. The on primary field option is optimal for these scenarios.


In complex and data-intensive forms, validation errors may occur due to interdependencies between the values entered in different fields. In these cases, consolidating all validation errors in one place can help users efficiently resolve issues. Choose the top of page option in such scenarios.

Move the error message to the top if there are dependencies. Mix and match both options (On primary field and Top of page) to help users quickly resolve errors.

Validation on

A field's validation can be triggered in one of the following modes:
  1. Save only: Choose this option if you want the validation to happen when the user clicks the Save button. Please note that all validation rules configured for that layout will be triggered when you click Save.
  2. Field verify and save: Users may need to validate an important field quickly before proceeding to other fields. For instance, you may want to validate the IBAN number before proceeding to fill other details.

    Validation of that specific field will occur upon clicking this button. The validation will be performed when saving the record as well. This allows for a quick verification of fields before proceeding to fill in other related fields.
The field verify and save option is not available in:
  • Canvas pages
  • Convert /mass convert pages
  • Stage closed popup (that appears when a deal is closed)
  • Details required popup (that appears when a layout rule is executed for a quick edit in the record detail page), and
  • Field of lookup popup.

Validation type

Fields are validated according to the parameters you've set in a validation rule, which can be defined in two different ways.
  1. Using criteria: You can easily set up validation rule parameters using a visual builder. Choose the primary condition to activate the rule and the secondary condition to apply it to specific records. You can also customize the error or alert message for each secondary condition.

  2. Using a function: You also have the flexibility to create a validation rule using a function if the previous type doesn't cover your use case. This provides you with complete control over your validation rule, enabling you to implement complex business logic and check data from other applications.

Note
  1. Validation rules that use functions aren't currently compatible with validation preference and error location options.
  2. You can only set a validation preference for the save only option.
  3. Error location is only accessible when the validation preference is set to stop with error.
  4. When the field verify and save mode is enabled, the error message will be displayed near the primary field, and you won't be able to save the record with the entered value.

Criteria-based validation rules

The following sections specifically address criteria-based validation rules. In the remainder of this document, when we refer to "validation rules", we're specifically referring to this type of validation rule.

To learn about validation rules using functions, read Create validation rules using functions.

Parts of a validation rule

  1. The primary field is the field being validated. In our running example, this would be the Discount field.

  2. During validation, the primary field value is checked against one or more primary conditions. You can specify up to 10 primary conditions, such as "Not between 0 and 15" or "Not between 0 and 10".

  3. You can decide if the primary condition is checked for all records or for subsets of records. Each primary condition can have up to five secondary conditions. For example, we can check whether the Discount (primary field) is less than 15% (primary condition) for deals from the NA and MEA regions (secondary condition). We can have another secondary condition for deals in the EU region. This way, we can validate a field differently based on values in other fields.

  4. Each secondary condition can have one error/alert message. This message content is customizable.

    Multiple error messages may be displayed for a field simultaneously because all primary conditions are checked when the validation rule is executed.

Execute rule on

You can decide when the validation rule should be executed. This is because you can define the criteria in two ways:
  1. You can set unwanted values in the primary condition(s) and specify that an alert should be triggered when the condition is satisfied. For instance, you could define the condition as a discount value exceeding 15 percent (undesirable) and notify the user when the input value fulfills this condition.

  2. Alternatively, you can set desired values in the primary condition(s) and indicate that an alert should be triggered if they are not satisfied. Specify the primary condition as a discount value below 15 percent (preferred) and notify the user if the input value doesn't meet this condition.

To create a validation rule

  1. Go to Setup > Customization > Modules and Fields.
  2. Select the module for which you want to create the validation rule.
  3. In the [Module] page, click the Validation Rules tab.
  4. Click Create New Validation Rule.
  5. In the Create Validation Rule pop-up, perform the following actions:
    1. Select the layout that the field you wish to validate belongs to.
    2. Select the field to validate.
    3. Select the validation type as Based on Criteria.
    4. Select either Save Only or Field Verify and Save for Validate on.
    5. Click Next.
  6. In the Validation rule editor page, specify the primary condition to initiate the rule. For instance, if you want to validate the discount field to keep out discounts more than 15%, your primary condition will be "Discount > 15%".

  7. Click Done.
  8. Select an Execute rule option from the dropdown list. In our example, we've defined the undesired value in the primary condition, so we'll select When criteria is met.
  9. Customize the error message according to your needs. In our case, we want to forbid the entry of a discount value greater than 15% for certain regions, so our error message will be, "You cannot provide a discount over 15% for deals from the NA and MEA regions."

  10. Configure the secondary condition. Set the other options like validation preference and error location if available. If you want the error message to be displayed for all records, leave it as-is. If you want to apply it to a subset or create multiple conditions, you'll have to edit it. In our example, we want this error message to be displayed only for deals from the NA and MEA regions. Accordingly, we can do the following:
    1. Click the More icon and then click Edit.

    2. In the Which records would you like to apply the rule to? pop-up, select Choose based on specific conditions.
    3. Define the criteria as needed.
      If you wish, you can drill down to select exactly the records you need by adding more criteria using the + button.

    4. Click Done.
    5. Click + if you want to add another secondary condition and repeat the previous steps to configure it.

  11. Click Add another option to add another primary condition.

  12. A fully completed validation rule will look something like this:

  13. Click Save (at the top-right of your screen). You've successfully created your validation rule.

Note
  1. If a field, used in primary or secondary conditions, is updated via a workflow rule, Blueprint, API, import, or webform, this field update will take precedence. This means that the validation rule will be overwritten by the field update. As a consequence, CRM will accept the value entered as a result of the field update over the validation rule. Learn more about the consequences of this here.
  2. In cases where you've created both a validation rule and a Blueprint validation for the same field and both have different conditions, the Blueprint validation will override the validation rule. This is true as long as the record is within a blueprint to which the Blueprint validation is applicable. When a record has exited a process, the validation rule is then effective.
  3. If records generated via webforms meet the validation rule criteria, they'll be submitted for manual record approval.
  4. Below are the numbers of conditions allowed within a validation rule:
    1. 10 primary conditions per rule
    2. Five secondary conditions per primary condition
    3. Five criteria per secondary condition
  5. Validation rules aren't supported for multi-select lookups, multi-picklists, multi-user field, formula fields, auto-number fields, image upload fields, and multi-line fields.
  6. You can validate images using Zia. To learn more, see Zia Vision.
  7. Validation rules are supported in the following areas:
  1. Create (web version)
  2. Quick create (web version)
  3. Edit (web version)
  4. Quick edit (Ajax, web version)
  5. Convert (single and mass)
  6. Kanban view
  7. Copy customization
  8. Sandbox

To edit a validation rule

  1. Go to Setup > Customization > Modules and Fields.
  2. Select the module for which you want to create the validation rule.
  3. In the [Module] page, click the Validation Rules tab.
  4. Click the validation rule that you want to edit.
  5. Make changes in the validation rule editor and click Save.

To deactivate a validation rule

  1. Go to Setup > Customization > Modules and Fields.
  2. Select the module for which you want to deactivate a validation rule.
  3. In the [Module] page, click the Validation Rules tab.
  4. Toggle the Status for the validation rule.
  5. In the pop-up that appears, click Deactivate now.

To delete a validation rule

  1. Go to Setup > Customization > Modules and Fields.
  2. Select the module for which you want to delete a validation rule.
  3. In the [Module] page, click the Validation Rules tab.
  4. Hover over validation rule that you want to delete.
  5. Click the Trash icon that appears.
  6. In the pop-up that appears, click Yes, Delete.

    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION






                          Quick Links Workflow Automation Data Collection
                          Web Forms Enterprise Begin Data Collection
                          Interactive Forms Workplace Data Collection App
                          Offline Forms Customer Service Accessible Forms
                          Digital Forms Marketing Forms for Small Business
                          HTML Forms Education Forms for Enterprise
                          Contact Forms E-commerce Forms for any business
                          Lead Generation Forms Healthcare Forms for Startups
                          Wordpress Forms Customer onboarding Order Forms for Small Business
                          No Code Forms Construction RSVP tool for holidays
                          Free Forms Travel Kiosk in mobile app
                          Prefill Forms Non-Profit

                          Intake Forms Legal

                          Form Designer HR

                          Card Forms Food
                          Assign Forms Photography

                          Translate Forms Real Estate
                          Electronic Forms

                          Notification Emails for Forms Alternatives
                          Holiday Forms Google Forms alternative 
                          Form to PDF Jotform alternative





                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • FAQs: Validation Rules

                                                                                                                What is a validation rule in Zoho CRM and why do I need it? In this data-driven world, it is crucial to ensure the validity and accuracy of your data. Data can enter your CRM system through various channels, such as advertisements, web forms, ...
                                                                                                              • Points to note while updating a field used in a validation rule.

                                                                                                                Validation Rules are effective on creating a record manually. However, when fields used in a validation rule (whether primary or secondary) are updated through other ways such as workflow update, and APIs, the field update takes precendence over the ...
                                                                                                              • Creating Validation Rules Using Functions

                                                                                                                By using function you can create a validation rule where the value entered by the user needs to be verified outside the CRM database. You can even validate the fields like phone numbers, zip code and so on for a particular pattern by mentioning the ...
                                                                                                              • FAQs: Workflow Rules

                                                                                                                What is a workflow rule? Workflow rules in Zoho CRM are designed to enhance productivity of the users and reduce manual work by automating routine activities in a business process. They allow you to create rules that can trigger different action ...
                                                                                                              • Configuring Workflow Rules

                                                                                                                Workflow Rules in Zoho CRM, are a set of actions (email notifications, tasks and field updates) that are executed when certain specified conditions are met. These rules automate the process of sending email notifications, assigning tasks and updating ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources