getBarcodeValue (Client API reference)
Invokes the device camera to scan the barcode information, such as a product number.
Available for
This method is supported only for the mobile clients.
Syntax
Xrm.Device.getBarcodeValue().then(successCallback, errorCallback)
Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
successCallback |
Function | Yes | A function to call when the barcode value is returned as a String. |
errorCallback |
Function | Yes | A function to call when the operation fails. An error object with the message property (String) will be passed that describes the error details. |
Return Value
On success, returns a string containing the scanned barcode value.
Exceptions
Example
Xrm.Device.getBarcodeValue().then(
function success(result) {
Xrm.Navigation.openAlertDialog({ text: "Barcode value: " + result });
},
function (error) {
Xrm.Navigation.openAlertDialog( {text: error.message} );
}
);
Related articles
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기