Skip to main content
A global object that provides access to the document, its fields, and the parameters of the transaction where the document is being processed. Assign the result of the check to the CheckSucceeded property.

Properties

NameTypeAccess LevelDescription
CheckSucceededboolRead-writeIndicates if the rule condition is fulfilled. The default value is true. Your script should set it to false if the condition is not fulfilled. In that case, the default error message will be displayed to the operator: “Error in the rule <rule_name>: <field_name>”. If you would prefer a different message, set it using the ErrorMessage property. Important! An error is only generated if CheckSucceeded is set to false. If the script did not change the value of CheckSucceeded to false, an error message will not be displayed even if the conditions have not been met.
CurrentFieldFieldRead-onlyThe field checked by the rule. For repeating fields checked by repeating rules: the particular instance of the field being checked by the current call. If the rule references the document as a whole, returns a null value.
DocumentDocumentRead-onlyThe document for which the rule runs.
ErrorMessagestringRead-writeUser-defined message to be displayed if the script set CheckSucceeded to false. If you do not set this property, the message displayed on error will be “Error in the rule <rule_name>: <field_name>
TransactionTransactionRead-onlyThe current transaction.

Methods

NameDescription
Field GetField(string fieldName);Gets the field by name or identifier. Important! Pass the string name of the field to this method directly: a variable with the same string value won’t work. The preprocessor that parses the script code before executing it will replace the name of the field with its identifier, but won’t be able to process a variable. Use the full path to address the fields that are contained within a field group, for example BusinessUnit/Address. When used in a repeating rule, this method will sequentially return each processed field instance. Otherwise, this method returns the first instance of a repeating field when one is referenced.
Field[] GetFields(string fieldName);Returns a list of fields that have the specified name. This method can be used to get all instances of a repeating field, including all cells in a table column. This method makes it easier to access repeating fields when using loops. Important! Pass the string name of the field to this method directly: a variable with the same string value won’t work. The preprocessor that parses the script code before executing it will replace the name of the field with its identifier, but won’t be able to process a variable.
Record GetCatalogRecord(string catalogId, string externalId);Gets a record from a catalog (external database). Use this method to get information from a catalog and compare the field values in the document to the field values in the catalog. The catalog name (catalogId) and catalog record identifier (externalId) are passed as arguments. This method can only be used if the appropriate identifier has been set up in the catalog (e.g. the vendor identifier).
SkillParameter SkillParameter(string ParameterName);Gets a value from the skill parameter. This method can only be used if the Document skill has at least one parameter.