1
Open the properties dialog box
Right-click the field and select Properties, or open the Document Definition properties (in the Document Definition editor, select Document Definition → Document Definition Properties).
2
Create a new rule
On the Rules tab, click New Rule. Select Script and click OK.
3
Set the common rule options
Type a Name, set the severity, conditions for applying the rule, and any Tags as needed, and click Next. For the full list of common rule options, see Set up rules.
4
Choose the available fields
In the Available Fields list, add the objects the script can use with Add and Delete. Fields with the Read Only option enabled can only be read; all other fields can be changed by the script.
Add every field you want to use in the script to this list. A field that is not in the list cannot be used by the script.
5
Write the script
Click Edit to open the script editor. Select the scripting language and enter the script. To check the script, select Tools → Check Script. To save it, select File → Save.
6
Finish
Click Finish. The rule appears on the Rules tab.
