Parameters
Write procedures that you use in more than one rule to the global rule module. Open it from the script editor. From the drop-down list on the toolbar of the script editor, select Rule Global Script Module. The global rule module can also be accessed from the Document Definition editor (Document Definition → Script Modules → Rule Script…).
Script rules can be used to access records of a cached data set. This can be useful if you need to create validation rules manually. Complete the following steps to access records in a cached data set:
- Connect to the data set using the IRuleContext.DataSet method.
- Create a query using the IDataSet.CreateQuery method.
- Add one or more conditions using the IDataSetQuery.AddValue method.
- Use the IDataSet.GetRecords method to get data that satisfies the query. If you need to determine how many records satisfy the query, use the IDataSet.GetRecordsCount method.
- You can get records with specific index numbers using the IRecordset.GetRecord method.
