A customer wants to add a backup barcode to a document, so that if the first barcode is damaged or unreadable, the second one can be processed instead. I'm trying to create a script that ensures only one of the two barcodes is processed, but I keep encountering the following error:

HRESULT: 0x80010105 (RPC_E_SERVERFAULT)

 

Is this kind of setup possible? Any tips or suggestions would be appreciated.

Here the script:

Dim output

If Not IsEmpty(BARCODE1) And BARCODE1 <> "" Then

    output = BARCODE1

ElseIf Not IsEmpty(BARCODE2) And BARCODE2 <> "" Then

    output = BARCODE2

Else

    output = ""

End If

 

output