Create a form for product inclusion using barcode

Hi to all, I would like to know which is the best way to create a form for product inclusion using barcode?

I am creating a master/detail form to include products to stock, those products comes with a barcode, to easily read its serial number, How can I do to include those products automatically when reading that code? I want that inmediatly after read the code the form show a new inclusion line, is that possible?

Its a little hard for me to explain better because english is not my native language… If you can not understand i`ll try to explain me better

Re: Create a form for product inclusion using barcode

Are you wanting to scan a barcode and have the app insert in new line to add the product you scanned the barcode for?
Will it add a new record automatically, or load an insert form to complete the rest of the info (desc, qty… etc)

Most scanners I have used emulate KB entry. Meaning it acts as though you typed in the code yourself manually including the CR to simulate the ENTER keypress. You should just have an entry box, scan the barcode.

If this is not the case, can I get more detail?

Regards,
Scott.

Re: Create a form for product inclusion using barcode

i have the same problem , i need a form for point of sales with barcode scanner

barcode is in deed so popular to be used on products,which is always seen in shops.as for the barcode scanner ,you may check this barcode scanner integration tutorial

A barcode scanner is only something which is installed between your keyboard and workstation. That way it doesn’t matter if you enter the code by hand or using the scanner: you click in the field which needs the code to be entered to get the focus on it, next you scan your code. The only problem might be that after scan there’s no automatic submit, so you need to click a button then. Didn’t follow the link, so it might have some other solution.

Hi

I made some test using Javascript.

Imagine to have an editable grid with a field named PRODUCTID. If you put this on the JS event onchange like that

function sc_PRODUCTID_onchange()
{
var n = F1.elements[“sc_contr_vert”].value;
n = (n - 1);
findPos(this);
nm_atualiza_line(‘incluir’, n);
document.F1.PRODUCTID.focus();
}

almost everything work well but… :mad: the focus on the new added row is not on the same field PRODUCTID.
Any idea to solve this?

Check your barcode reader settings whether it adds an extra carriage return or tab or something. You should be able to set that using your manual from the barcode reader.
Often you get a booklet with barcodes for changing settings in your barcode reader.
Grab notepad.exe and scan a barcode to see what is exactly returned from the barcode reader. THe onchange is triggerd if you leave the field, hence a tab after the barcode string should suffice for the
event to be triggered.

Yes. That it’s what i do.
Work perfectly but after inserting the first record the focus don’t return to the correct field (PRODUCTID) and i have to move it by hand to be ready to receive the follow barcode.
I do not know if the command that i use ( document.F1.PRODUCTID.focus(); ) is the correct one to produce the desired effect but i’ve found no other documentation about and seems SC don’t offer support to “undocumented functions”.
A workaround is setting the barcode reader to insert more tab after the barcode to simulate a keyboard action but i don’t like so much. :frowning:

Sadly enough you need the <tab> or <cr> to have have you it create an event.
Now I see you have created the function, I assume that you are actually also calling this function in the OnChange event right?
In fact you can just use:

var n = F1.elements[“sc_contr_vert”].value;
n = (n - 1);
findPos(this);
nm_atualiza_line(‘incluir’, n);
document.F1.PRODUCTID.focus();

Leave the while function out of it…
You must check tho that this piece: document.F1.PRODUCTID. is correct tho. So use firefox and the F12 button to inspect the details of your field…

I hope this helps you a little bit.

As always it was easier than it looked.

Solved adding sc_set_focus( ‘PRODUCTID’ ) on the event OnLoad

So now I have a total control and I can insert new rows via a barcode reader without any intervention from the keyboard. Great!

Resuming:

JavaScript

var n = F1.elements[“sc_contr_vert”].value;
n = (n - 1);
findPos(this);
nm_atualiza_line(‘incluir’, n);

OnLoad

sc_set_focus( ‘PRODUCTID’ )

Thanks to all for suggestions.

[QUOTE=rr;18570]Check your barcode reader settings whether it adds an extra carriage return or tab or something. You should be able to set that using your manual from the barcode reader.
Often you get a booklet with barcodes for changing settings in your barcode reader.
Grab notepad.exe and scan a barcode to see what is exactly returned from the barcode reader. THe onchange is triggerd if you leave the field, hence a tab after the barcode string should suffice for the event to be triggered.[/QUOTE]

Thanks very much. It’s very helpful in my own case dealing with barcode issue.