Greetings. I am creating a screen that will be used at our facility that will log what’s been scanned, and who scanned it. Everything works fine with the exception I don’t know how to have this script fire after the enter key has been pressed. This is my script that I’ve put on the text box itself, I need this to happen automatically after the label has been scanned:
p = event.source.text
u = system.security.getUsername()
system.db.runPrepUpdate(“INSERT INTO endlinescan (Scan,userscanned) VALUES (?,?)”, [p, u])
system.gui.messageBox("Scan Complete " + p + " was scanned by: " + u)
I’m assuming the script needs to be attached to the actual text box itself, I don’t want a button for them to click, and I don’t want them being able to go back and edit what’s been scanned etc. I just need a simple logging to SQL table on each scan. Any help? Also, I’m under the assumption it’s on the “Key pressed” event in scripting, if that’s not accurate my apologies.