Capture Image on Sales Order

Capture Image on Sales Order

You are here:


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.


This article requires the following:

  • Business Central version 15 or higher
  • Warehouse Insight Advanced WMS version 2.0 or higher


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

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
Code - AddAttachment


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

Scanner - Output
BC - Attachment
Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Need help?

One Comment

  1. Raymond Trudeau
    Raymond Trudeau November 12, 2020 at 2:41 pm

    I would suggest instead setting the “Document Reference ID” after validation of the file name. In addition, can likely use the “image_file_name” property from the precEventParams object instead of hardcoding to file name to “image.png”.

Leave A Comment

Go to Top