---
title: "Capture Image on Sales Order"
app: "Warehouse Insight"
section: "Developer"
last_updated: "2026-08-17"
url: "https://insight-works.com/kb/warehouse-insight/capture-image-on-sales-order/"
---

# Capture Image on Sales Order

### Objective

In some cases, users of Warehouse Insight will want to be able to take pictures and add that picture to the document from their mobile devices. This article will walk through the steps and code required to add capture a picture on a Sales Order from the device and add it as an attachment to the document.

### Requirements

This article requires the following:

- Business Central version 15 or higher
- Warehouse Insight Advanced WMS version 2.0  to version 2.6 (this does not apply to any version newer than 2.6)

1.

 Note: If you are on Warehouse Insight Advanced WMS version 2.6 or newer, see the [_Capture an Image on a Scanner Using Warehouse Insight_](/kb/warehouse-insight/capture-an-image-on-a-scanner-using-warehouse-insight/) page.

### Steps

The following steps/code can be modified or extended as required and assume a base level familiarity with Business Central and Warehouse Insight.

#### Add a Menu

1. Navigate to the _Warehouse Insight Device Menus_ page in Business Central.
2. Select **Application **from the _Form_ dropdown.
3. Select **WHSE\_RECEIPT\_DOC** from the _Application_ dropdown.Note: You must select this for each form you require using the take picture function in.
4. Create a new menu at the end with the following properties:

   - Caption: Take Picture
   - Event ID: 976
   - Require Line : YES
   - Standard Action: Take Picture

### Create the Extension

You must handle custom events before the base product execution occurs. We will be subscribing to the “OnBeforeProcessEvent” and listening for the event defined on the Menu (ID 2000000).

1. Create an extension codeunit to process the request and save the picture as an attachment.

![Code - OnBeforeProcessEvent](/wp-content/uploads/kb-legacy/Code-OnBeforeProcessEvent.png)

 Note: Custom Event ID’s should start in the 2 million range.

The code for saving the attachment is given below. When done, the custom event must indicate the event was handled to avoid errors being generated by base Warehouse Insight.

![Code - HandleTakePicture](/wp-content/uploads/kb-legacy/Code-HandleTakePicture.png)

![Code - AddAttachment](/wp-content/uploads/kb-legacy/Code-AddAttachment.png)

## Result

Once the extension codeunit has been published comments can now be added via the “Add Comment” menu option on the document.

![Scanner - Output](/wp-content/uploads/kb-legacy/Scanner-Output.png)

![BC - Attachment](/wp-content/uploads/kb-legacy/BC-Attachment.png)

 Note: The codeunit .al file has been attached to this article for easier reference.

[Download the Codeunit .al file](/wp-content/uploads/kb-legacy/Codeunit-50500.zip)
