-
Notifications
You must be signed in to change notification settings - Fork 24
MobileCRM.Platform.scanBarCode
rescocrm edited this page May 15, 2023
·
9 revisions
Activates the bar-code scanning.
If the current platform does not support the bar-code scanning, the failed handler is called with error "Unsupported".
| Argument | Type | Description |
|---|---|---|
| success | function(result) | A callback function for successful asynchronous result. The result will carry an array of strings with scanned codes. |
| failed | function(error) | A callback function for command failure. The error argument will carry the error message. |
| scope | A scope for calling the callbacks; set "null" to call the callbacks in global scope. |
This example demonstrates how to call Barcode scanner and get the barcode.
MobileCRM.Platform.scanBarCode(function (barcodes) {
/// <param name="barcode" type="Array">Array of scanned barcode</param>
barcode = "";
for (var i in barcodes)
barcode += "\n barcode " + i + " : " + barcodes[i];
MobileCRM.bridge.alert(barcode);
}, MobileCRM.bridge.alert);