How to prevent barcode scanner from creating record when nothing is scanned?

Background: my barcode scanner creates a record every time it detects a barcode.

Problem: when I tap "back" at the scanning screen (no barcode is detected), the scanner creates a record as well.

Question: how do I not create a record when I tap "back"?


Solution

YS Yeo wrote:

Background: my barcode scanner creates a record every time it detects a barcode.

Problem: when I tap "back" at the scanning screen (no barcode is detected), the scanner creates a record as well.

Question: how do I not create a record when I tap "back"?



Hello!

Insted of checking for a NullIdentifier() on the result, check for ScanBarcode.Error.ErrorMessage = "cancelled" or ScanBarcode.Error.ErrorCode = 3

You can also check for ScanBarcode.Success, it will return False if you press the Back button.

Let me know if this fixes your issue.

Solution