Based on the values in the record, validation rules prevent users from creating or updating the records, or changing project phases. If the qualifier in the rule is met, the rule prevents the operation and displays a message to the user.
•When a user attempts an operation, validation rules execute after all applicable security rules and pre-population rules, as described in the execution order listed in Points to Remember.
•Validation rules compare their qualifiers to the values in the record at the time when the user attempts an operation, not when the record was opened.
•Validation rules may control the Create or Update operations for any object, or for the Phase Change operation in a custom object. See Rule Triggers for a complete set of triggers according to each object.
•Page Transition rules in wizards function like validation rules. They "validate" the information that the user enters in each wizard page to ensure that the data is entered properly. They also use this information to determine which wizard page to display next. For more information, see Creating Wizards.
For example, you might write a validation rule for involved party records of the Dispute object, which checks:
•Whether the current user who is attempting to update a dispute record is a member of the Dispute Attorney group
•Whether the involved party record has the Outside Counsel Firm category
•Whether the Involvement Date field of the involved party record is empty (has a null value)
If all of these conditions are present, the rule prevents the record from being updated and displays a message to the user such as Involvement date of the involved party cannot be empty.
This is a validation rule rather than a security rule because the value in the Involvement Date field when the user opened the record is irrelevant. The purpose of the rule is to make sure that the Involvement Date field has a value when it is saved.
When writing a validation rule for the Create operation, make sure that you also write a validation rule for the Update operation that complements the Create rule, if necessary. This action ensures that the conditions you specify are met at all times.
For example, if you want to ensure that dispute records are always saved with at least one assignee, you must create two identical validation rules: one for Create and one for Update. If only the Create rule is used, a user may open an existing record and save (update) it after that user has deleted the assignee. To prevent this action, write a rule that requires an assignee when users update the record.