AnsweredAssumed Answered

Barcode Scanning scripting loop

Question asked by Ian on Dec 8, 2013
Latest reply on Dec 8, 2013 by philmodjunk

Title

Barcode Scanning scripting loop

Post

     Hello I'm trying to scan barcodes on the same layout as showing the resulting scans as a list, I have placed a Global scan field on the footer of the list layout with a OnObjectKeystroke trigger which triggers with a TAB suffix from the scanner. Everything works fine except till at the end of the script where it points back to the global field to wait for another scan, then it gets into a loop of creating new empty records till I cmd "." to break out of the loop

     I'd like to show the scanned results as a visual check. Could someone please shed some light what I could change / add to stop the looping, some how it self triggers even though nothing is scanned or TAB entered in the Global field.

     Thanks, Ian

      

         
  •           If [ Code ( Get(TriggerKeystroke) ) = 9 ]
  •      
  •           Set Variable [ $Scan; Value:Training::Barcode Global ]
  •      
  •           If [ $Scan = "ENDSCAN" ]
  •      
  •           Exit Script [ ]
  •      
  •           End If
  •      
  •           Clear [ Training::Barcode Global ] [ Select ]
  •      
  •           New Record/Request
  •      
  •           Set Field [ Training::Contact Index; $Scan ]
  •      
  •           Enter Find Mode [ ]
  •      
  •           Set Field [ Training::Scan Date; Get ( CurrentDate ) ]
  •      
  •           Perform Find [ ]
  •      
  •           Sort Records by Field [ Descending; Training::Training Index ]
  •      
  •           Go to Record/Request/Page [ First ]
  •      
  •           End If
  •      
  •           Go to Field [ Training::Barcode Global ]

Outcomes