Skip to content

OpenBarcodeScanner

Define action that allow users to open a barcode scanner on a mobile device.

The properties defined in Action are also applicable to this action.

OpenBarcodeScanner Properties

Property Type Required
Path string Optional
_Type const Required

Path

  • type: string

_Type

OpenBarcodeScanner: This action will open the barcode scanner and return result after scanning.

  • type: const

The value of this property must be equal to:

"Action.Type.OpenBarcodeScanner"

Action Result

The ActionResult of this action is the display value of the scanned bar code.


Examples

{
    "_Type" : "Action.Type.OpenBarcodeScanner",
    "OnSuccess" : "/MDKApp/Rules/BarcodeScanner/ShowBarcodeScanningResult.js", 
    "OnFailure" : "/MDKApp/Actions/BarcodeScanner/OpenBarcodeScannerFailure.action",
    "ActionResult": {
        "_Name": "BarcodeScanner"
    }
}
export default function ShowBarcodeScanningResult(pageProxy) {
  var actionResult = pageProxy.getActionResult('BarcodeScanner');
  if (actionResult) {
    pageProxy.setActionBinding({
      'Result': actionResult.data,
    });
    return pageProxy.executeAction('/MDKDevApp/Actions/Navigation/BarcodeScanner/NavToBarcodeScannerSuccessPage.action');
  }
}