Auto save a new record without having to click ‘Save as copy’

An AppGini customer told me recently that he has a table containing only one field, a barcode field, that he uses a barcode scanner to populate. He has thousands of items to enter, and wanted to know if there is someway to expedite his workflow, maybe by avoiding to click ‘Save as copy’ everytime he scans a new barcode.

I suggested the following code to him, to be placed in the hooks/tablename-dv.js (where tablename is the name of the concerned table — create that file if it doesn’t already exist).

Change fieldname in line 2 above to the actual name of the barcode field. The above code checks if the concerned barcode field has been changed. If it has been, the ‘Save as copy’ button (using the #insert selector) is clicked.

Published by Genedy

I'm the founder of BigProf Software. We're a tiny team of developers who create tools that make it easy (and affordable) for anyone to create connected business applications that work from any device with a browser.