Configuring Attachments

By default, the mobile application enables file attachments and displays them on a screen if the screen supports the attachments. However, the default handling of attachments can be overridden.
Note: On iOS devices, it is possible to upload only image files. Files of other types are not supported.

Example: Configuring a Screen with Attachments

The following sample code gives the Invoices (SO303000) screen the ability to accept attachments of various formats. To see an example, add the Invoices (SO303000) screen to your customization project (as described in To Add a Screen to the Mobile Site Map (Example)), copy the code below to the Commands area of the Add: SO303000 page, and publish the project.

add screen SO303000 {
  add container "InvoiceSummary" {
    add field "Customer"
    add field "Location"
    add field "Terms"
    add field "DueDate"
    add field "CashDiscountDate"
     add field "Currency" {
      selector {
        add field "CurrencyID"
      }
      PickerType = Attached
    }
    add recordAction "Save" {
      behavior = Save
    }
    add recordAction "Cancel" {
      behavior = Cancel
    }
    attachments {
      add type "jpg" {
        extension = "jpg"      
      }
      add type "png" {
        extension = "png"
      }
      add type "pdf" {
        extension = "pdf"
      }
    }
  }
}

To enable or disable attachments and configure the file types that are allowed, you use the attachments instruction inside the container object.

Note: If a screen does not support attachments, the attachments are not displayed even if you set the disabled attribute of the attachments instruction to False.

The screenshot below shows the resulting screen in the mobile application. To attach an item, the user taps the paper clip symbol in the top right corner of the screen. After at least one item has been attached, the number next to the paper clip indicates how many items have been attached.

Figure 1. A screen with attachments


The Enhancement of Images Taken from the Camera

The functionality of enhancing images taken from the camera of a mobile device is implemented in the MYOB Acumatica mobile app. This image enhancement makes the image look better and more readable. This functionality is useful for any printed document, such as expense receipts that may be attached to documents in MYOB Acumatica.

To switch on image enhancement in the MYOB Acumatica mobile app, you should set the imageAdjustmentPreset attribute to Receipt in the attachments instruction of the mobile site map as follows.
attachments {
      imageAdjustmentPreset = Receipt
}
When the imageAdjustmentPreset attribute is set to Receipt, a corresponding button appears in the attachment area (see the screenshot below). When a user taps the highlighted button, a special camera mode is switched on in the MYOB Acumatica mobile app. In this mode, the following enhancements of the image captured by the camera are performed:
  • The image is cropped by the bounding box of the detected edges.
  • Any image distortion is removed.
  • The image is converted into black and white.
  • The contrast of the image is maximized.

Each of these enhancements is first performed automatically and then the user can also add manual adjustments. The automatic changes cannot be undone.

Figure 2. A screen with the attachment area to add photos in enhanced mode


If the imageAdjustmentPreset attribute is not specified or has value other than Receipt, the MYOB Acumatica mobile app attaches the original image taken from the camera.