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).
1 2 3 4 5 |
$j(function(){ $j('#fieldname').change(function(){ $j('#insert').click(); }); }) |
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.