Scripts for Validation
Scripts can be used to fail validation: by raising an error, they prevent the current action.
You can use this to set complex conditions on a fieldâ€™s value, for example to conform to a particular numbering scheme or data format. Another use is to ensure that multiple fields relate to each other: if one field is blank, another must be filled. Or use a task script to prevent a task from being closed unless required data has been entered in the task.
See examples of custom validation