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

# On Task Reject

> On Task Reject runs before a FlexiCapture task is rejected via the Reject Task command; set CanReject to false in the script to cancel rejection.

## When it is launched

The script is launched prior to rejecting the task.

* If the **CanReject.Value** property is set to **true**, the task will be rejected after the script execution.
* If the **CanReject.Value** property is set to **false**, the task will not be rejected.

By default, the value of the **CanReject** parameter is **true**.

<Note>
  The event occurs only when using the Reject Task command. When closing the station the event does not occur.
</Note>

## Parameters

| **Name**  | **Type**                                                         | **Access** | **Description**                      |
| --------- | ---------------------------------------------------------------- | ---------- | ------------------------------------ |
| CanReject | [IBoolean](/flexi-capture/appendix/scripts-shell/iboolean)       | Read/write | Specifies whether to reject the task |
| Context   | [ITaskWindow](/flexi-capture/appendix/scripts-shell/itaskwindow) | Read/write | The task window                      |
