> ## 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.

# IRuleContext

> IRuleContext is the context object for FlexiCapture rule scripts, giving access to the document, rule fields, cached data sets, and check results.

## What it does

A context object of rules. Represents the object, at whose level the rule was created.

The object implements [IField](/flexi-capture/appendix/scripts/ifield) interface (by means of providing access to the context field of the rule) and also has additional methods.

## Methods

| **Definition**                                                                          | **Description**                                                                                                                 |
| --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| DataSet ( dataSetName : string ) : [IDataSet](/flexi-capture/appendix/scripts/idataset) | Accesses the cached data set. The resulting [IDataSet](/flexi-capture/appendix/scripts/idataset) is available for reading only. |

## Properties

| **Name**       | **Type**                                               | **Access**                                                                       | **Description**                                                                                                                                                                          |
| -------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CheckSucceeded | bool                                                   | Read/write, Mutable (can be modified even in scripts with read-only permissions) | Specifies whether the check succeeded                                                                                                                                                    |
| Document       | [IDocument](/flexi-capture/appendix/scripts/idocument) | Read-only                                                                        | Access to the document                                                                                                                                                                   |
| ErrorMessage   | string                                                 | Read/write, Mutable (can be modified even in scripts with read-only permissions) | A message concerning a rule error                                                                                                                                                        |
| Fields         | [IFields](/flexi-capture/appendix/scripts/ifields)     | Read-only                                                                        | Collection of fields in the rule. Specified in rule settings.                                                                                                                            |
| FocusedField   | [IField](/flexi-capture/appendix/scripts/ifield)       | Read/write, Mutable (can be modified even in scripts with read-only permissions) | The field to be focused when clicking a rule error (the field that caused a rule error).                                                                                                 |
| FocusRect      | [IRect](/flexi-capture/appendix/scripts/irect)         | Read-only                                                                        | A rectangle in screen coordinates, the executed action refers to (a rectangle of the window). Applies in the [Custom Action](/flexi-capture/appendix/scripts/script-custom) script only. |
| ParentWindow   | int                                                    | Read-only                                                                        | A handle of the parent window. Applies in the [Custom Action](/flexi-capture/appendix/scripts/script-custom) script only.                                                                |
