local variables not resetting

So I have the requirement to use a barcode scanner and when user enters a value the field resets so they can enter a new value. Since it's not possible to actually clear the contents of an input field, I decided to do a work around by having 2 barcode readers and alternate between them. However, this only works within the designer and does not work on preview mode nor when I run it on the process model. When I enter a value on the first barcode reader the second barcode reader shows up but it keeps the value of the first barcode and vice versa. It properly reads the values and does whatever it's supposed to do with them. I'm displaying the values in the local variables and I can see that they are resetting but the fields themselves are not. Here is my code for this.

 

a!barcodeField(
                  label: "Scan RAD Worker Badge",
                  placeholder: "Badge Number",
                  value: local!badgeNumber,
                  saveInto: {
                              local!badgeNumber,
                              a!save(local!badgeNumber2, null)
                              
                              
                          },
                  refreshAfter: "KEYPRESS",
                  showWhen:  and(local!entryMode = cons!HRA_TXT_ENTRY_MODE_SCAN, local!badgeReset = true)
              ),
a!barcodeField(
                label: "Scan RAD Worker Badge 2",
                placeholder: "Badge Number",
                value: local!badgeNumber2,
                saveInto: {
                  local!badgeNumber2,
                  a!save(local!badgeNumber, null)

                },
                refreshAfter: "KEYPRESS",
                showWhen:  and(local!entryMode = cons!HRA_TXT_ENTRY_MODE_SCAN, local!badgeReset = false)
              ),

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data