Auto-save new record without clicking 'Save' button
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.