function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hcri50hcri50 

Reading a Bar Code Scanner

I have a project that requires time management of certain projects.

When a person starts a project. They would scan the bar code on the invoice and insert the time of when it got started. And when done, they would scan the invoice again and the time would be recorded again. This in return would calculate the total time that it took.

 

Is it possible to read a bar code? 

CloudHugger2CloudHugger2

barcode scanners usually just scan the code and pass the value into a text field.

 

if you have a VF page open at the time with focus on a text field, the scanner would pass in the value direct to your text field.

 

further - if you have an actionsupport to monitor for onchange event you could fire off some sort of action, like starting a timer for example.

sfdcfoxsfdcfox
CloudHugger is correct on this matter, although I thought I'd expound on the information in case it was unclear.

I'm working on several barcode-scanner enabled pages right now, and basically all you need to know is that most scanners, by default, append a carriage return (Enter key) to their output on a successful decode.

Generally, this means you'll need to simply detect an Enter keypress on the field that has focus and handle it appropriately (e.g. by cancelling a form submit, if applicable, etc), and process the input that was received into the field.

For scanners that do not output an Enter key (or tab, etc), you can simply set a timeout when a character is received (a value of 100ms should usually suffice), and simply read the value of the text field when the timer expires.
hcri50hcri50

Thank you, I am going to try to grasping this. I am having problems in reading the barcode. It will not detect it. 

I will be back, and see wthat I am doing wrong. 

THANK YOU AGAIN

hcri50hcri50

THANK YOU

This is all new to me. Thank you for your input. And at least I know what to look for.

 

I seem to have a problem with my laptop for not recognizing the scanner. 

I need to figure what is going on

Thank you again to both of you

Joe RavitskyJoe Ravitsky
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000000ptq1EAA, Gimbal is coming our with a barcode scanner app as well. They can provide many of the customizations you might be looking for.