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

# CreateError activity for a multi-document case

> Configure the CreateError Pega activity for a multi-document case: open the case by handle and display the supplied error message using Page-Set-Messages.

The `CreateError` activity opens the case and posts the error message it is given.

For the general procedure, see [Create a Pega activity](/flexi-capture/connectors/pega/pega-activity-create).

## Pages and classes

| Page name | Class   |
| --------- | ------- |
| `Case`    | `Work-` |

## Parameters

| Name           | Data type | Required |
| -------------- | --------- | -------- |
| `CaseId`       | `String`  | Yes      |
| `errorMessage` | `String`  | Yes      |

## Activity steps

<Steps>
  <Step title="Open the case">
    | Field              | Value                |
    | ------------------ | -------------------- |
    | **Method**         | `Obj-Open-By-Handle` |
    | **Step page**      | `Case`               |
    | **InstanceHandle** | `Param.caseId`       |

    <Frame>
      <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega168.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=d2374f097195389263acac8185ea4913" alt="Screenshot of the CreateError activity in Pega, showing Step 1 with the Obj-Open-By-Handle method on the Case step page and InstanceHandle set to Param.caseId." width="870" height="249" data-path="images/flexi-capture/connectors/Pega168.png" />
    </Frame>
  </Step>

  <Step title="Post the error message">
    | Field       | Value                |
    | ----------- | -------------------- |
    | **Method**  | `Page-Set-Messages`  |
    | **Message** | `Param.errorMessage` |

    <Frame>
      <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega169.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=daf1706b2e3386a1b71a1e39b15f98c7" alt="Screenshot of the CreateError activity in Pega, showing Step 2 with the Page-Set-Messages method and the Message parameter set to Param.errorMessage." width="895" height="195" data-path="images/flexi-capture/connectors/Pega169.png" />
    </Frame>
  </Step>
</Steps>
