Displaying the number of items scanned in session data

bgamrat

New Member
We are working on a Remove Scan with a Panasonic FZ-X1 - Android - TracerPlus Client and Desktop 9.5.0.1454.

The strategy is to deliver all the items of a category which are at a location, allow the user to scan the items that are actually there, then sync back up to the server any items which were not scanned. The items sent back to the server would be marked missing using a database trigger.

In order to help the user monitor their progress quickly, I would like to display the number of items scanned.

When an item is scanned, the scanner_device_id in the session data is set to 'self'. A filter is used to upload only those items in session storage that do not have scanner_device_id set to 'self'.

I created a field of type Variable named scan_count. It is Visible. Show in grid and Read-only are not checked.

The Variable type is SQL.

The Trigger Field is Barcode.

The Custom SQL is SELECT COUNT(*) FROM Session2 WHERE Session2.Field6 = 'self'

Questions:
  1. Is there a better way to display a count of the number of items scanned?
  2. What should the After Scan settings be to ensure that the Barcode scan operates properly? Right now, I have unchecked all the boxes under After Scan. After a scan, the Barcode field is not submitted to the Session store and the field is not cleared, the next barcode scanned is concatenated. If I change the variable type from SQL to something else, the scanning works okay.
  3. How should the SQL be written to accomplish this?
I used: https://support.tracerplus.com/index.php?/Knowledgebase/Article/View/216/0/writing-sql-queries-for-tracerplus as a reference.
 

OliverR

Member
If I understand your question correctly, I think you could achieve this by just adding a grid on your form (possibly on a hidden tab, if you don't need it for anything else), and set the grid to display the session data, with a filter that only shows records where the scanner_device_id = 'self'. Then, in the grid properties, you set the "record count control ID" either to a label on your form if you just want the user to be able to quickly see how many items they've scanned, or you can set it to a field that you can save.

This is a lot more straightforward and doesn't require custom SQL code.
 
Top