# Receipt Message

*Again, after clicking the **'Messages' icon**, you are directed to the following screen (note: the three previously configured messages are now visible in the list):*

![](broken-reference)

1\) Click on the **ellipsis** to the right of the **CreateIncidentReceipt** Message & click **Copy**.

{% hint style="success" %}
Rather than create the Receipt Message from scratch, it will be quicker to copy the CreateIncidentReceipt Message and make one minor change.
{% endhint %}

## Copy Message Modal

The fields to edit for the Copy Message modal are as follows:

|  #  | Field        | Description                                           | Value     |
| :-: | ------------ | ----------------------------------------------------- | --------- |
|  2  | Message name | The message name that is unique for this integration. | 'Receipt' |

*Your Copy Message modal should look like this:*

![](broken-reference)

3\) Click **Copy**.

You will be redirected to the Details page of the newly created Receipt Message.

## Script Editor Fields

Navigate to **Advanced > Script Editor**, then **View > Inbound**.

*Your Script Editor fields should initially look like this:*

![](broken-reference)

The Script Editor fields to be edited are as follows:

|  #  | Field                     | Description        | Value                                                                               |
| :-: | ------------------------- | ------------------ | ----------------------------------------------------------------------------------- |
|  4  | Stage to Target (Inbound) | The script to run. | **Delete** the following code that sits outside of the End tag: **bond.setOpen();** |

## Scripts

*The code in the 'Stage to Target' script field should look like this:*

```javascript
//===== [ws] Begin Unifi Auto Generated Code =====//

/*
 * This code (between the Begin and End comments) is generated from the
 * Field and Field mapping records which are configured as part of the integration.
 *
 * All code either above or below the comments will be automatically maintained
 * through the build cycle.
 *
 * WARNING: Do not edit the Begin or End comments.
 */



if (x_snd_eb.ws_console.hasError()) {
  var errors = x_snd_eb.ws_console.get({type: 'error'});
  if (errors.length) {
    throw errors[0];
  }
}

//===== [ws] End Unifi Auto Generated Code =====//
```

*Your Script Editor fields should now look like this:*

![](broken-reference)

5\) Click **Save**.

6\) Click **Build Message**.

You will see the 'Message build successful' Info Message.

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MQxfgO8mw1gUB1Ab5bb%2F-MR0_tANOPBhx2H3fF2k%2FV2%20-%20Receipt%205.png?alt=media\&token=9c5f0d2b-909e-48cc-841a-b6a2a6e356d9)

7\) Click the **'Messages' icon** to move on & configure the **UpdateIncident** Message.

{% hint style="info" %}
There is no further configuration required for the Receipt Message.
{% endhint %}
