Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt

Use this file to discover all available pages before exploring further.

Context is a global object that provides access to the document being processed, its fields, and the parameters of the enclosing transaction. Set CheckSucceeded to indicate whether the rule passed.

Properties

CheckSucceeded

Type: boolAccess: Read-write Indicates whether the rule condition is fulfilled. Defaults to true. Set it to false if the condition is not met. In that case, the default error message shown to the operator is Error in the rule <rule_name>: <field_name>. To customize the message, set the ErrorMessage property.
An error is generated only when your script sets CheckSucceeded to false. If the script doesn’t set it explicitly, no error is displayed — even if the rule conditions aren’t met.

CurrentField

Type: FieldAccess: Read-only The field checked by the rule. For repeating fields in repeating rules, this is the specific instance being checked by the current call. Returns null if the rule references the document as a whole.

Document

Type: DocumentAccess: Read-only The document for which the rule runs.

ErrorMessage

Type: stringAccess: Read-write Custom message displayed when the script sets CheckSucceeded to false. If unset, the default message is Error in the rule <rule_name>: <field_name>.

Transaction

Type: TransactionAccess: Read-only The current transaction.

Methods

GetField

Field GetField(string fieldName);
Gets a field by name or identifier. Use the full path to address fields inside a group — for example, BusinessUnit/Address. When used in a repeating rule, GetField sequentially returns each processed field instance. Otherwise, it returns the first instance of a repeating field.
Pass the field name as a string literal, not a variable. The script preprocessor replaces the literal name with the field’s identifier before execution — variables aren’t processed.

GetFields

Field[] GetFields(string fieldName);
Returns all fields with the specified name — useful for iterating over every instance of a repeating field, including every cell in a table column.
Same preprocessor constraint as GetField: pass a string literal, not a variable.

GetCatalogRecord

Record GetCatalogRecord(string catalogId, string externalId);
Gets a record from a data catalog (external database). Use this method to compare document field values against catalog field values.
Available only if the catalog has a record identifier configured (for example, a vendor identifier).

SkillParameter

SkillParameter SkillParameter(string ParameterName);
Gets a value from a skill parameter.
Available only if the Document skill has at least one parameter.

Object model

Full JavaScript object reference for use in Advanced Script Rules.

Business rules automation

Add scripted rules to a Document skill, configure readable and writable fields, and reference table columns.

Field

The Field object — inspect and modify a document field during rule execution.