C
ChUIMonster
Guest
If the scanner driver supports a "scanOnlyPartNumbers" and "scanOnlySerialNumbers" properties then you should set those. Otherwise you are going to need to employ some business logic. If the business process is very structured and only one or the other can be validly used at a given moment then perhaps you just need to disable the one that should not be used until such time as it is appropriate to use it. Or just ignore input from the "wrong" scanner (that would be pretty bad UI though). Or, if either scanner could be used at any arbitrary time, then you need some logic such as what Patrick shows. Basically -- when a scan is completed determine if the scan is a "part number" or a "serial number". Maybe there is a simple way to do that -- perhaps all "part numbers" start with "P" and serial numbers start with "S". Or maybe parts have 6 digits and serial numbers have 8. Or maybe (as Patrick suggests) they already exist in the db and you can look them up to see which sort of number it is. Only you know how the part numbers and serial numbers can be differentiated and how you can determine which one was just scanned.
Continue reading...
Continue reading...