Try changing the type of the field Functions::Function Read from "number" to "text"
P.S.: even Stock::Stk_Number must be a text type field.
It is text
Everything looks as though it should work to me...very stumped and I need this done by 2pm today....ARG!
You have this step:
Perform Find [Restore]
What criteria is specified in that step? That restored find criteria might be why you aren't finding the record you expect.
Have you confirmed that the bar code data is being successfully and correctly entered into the FunctionRead field?
You might run this with the debugger if you have advanced or you can put a pause just before the set field step that clears the field to check to see what value is actually entered into the field when the bar code is scanned.
I have now changed it several times trying to figure out what is going wrong. In the perform field is: Find Stock::Stk_Number = $$MyStock
I would rather have it grab the scanned barcode, search for the record, modify it, and clear the field ready for the next scan all in one script. I have tried doing it with one script, and breaking it into two scripts.
Botton line is I cannot get it to find the correct record to complete the script. Pulling my hair out...
I used one of my community leader privileges to "suspend" the duplicate posts. I'll report this to Modman so that he can take a look at it.
In the perform find [restore] step is: Find Stock::Stk_Number = $$MyStock
Since you are already using Set Field just before to enter this same criteria. Clear the restore option.
There's a bug with global variables in find mode when the file is hosted from a server that might be an issue here as well. You may need to use a global field instead of the variable.
To repeat an earlier question: Have you verified that Functions::Function Read successfully recieves the scanned data and that this data is exactly correct for your find?
Thank you so much for fixing that! =)
tried global field, did not work either
how would you suggest I verify the scanned data?
Would it be easier for you to see the file?
If so, where can I place a zipped up file for you to grab?
Let's not go there until we confirm that the scanned data entered into the field is correct.
I already suggested several ways that you can check this. If you have advanced, just run the script with the debugger and use the data viewer to watch the contents of the fields in question.
You can add a pause step just before you clear the field
Add a show custom dialog step just before you clear the field and use it to display the field's contents.
After running the script, use Modify Find from the records menu to review the critieria this script entered to see what values were entered into the fields for the find.
Ok, I put in a dialog to show what is in the global field I put my search data in, guess what...it is getting nothing. I even tried setting it to
suggestions kind sir?
Make sure that the cursor is being put in the correct field before the scanned data is input.
I implement scans with two scripts and two triggers.
First, I configure the scanner to put keystrokes at the beginning of the scanned data. Then I configure the scanner to add either a Tab, Return or Enter keystroke to the end so the scann action automatically exits the field in which I am capturing the scanned data.
Script on is performed with an OnKeystroke trigger set on the layout. It simply uses Get ( TriggerKeystroke ) and Get ( TriggerModifierKeys ) to confirm that a scan was initiated. (I use a combination of a single character plus two modifier keys such as shift and caps lock to guard against accidents.) The script then uses either go to field or go to object to place the cursor in the field in which I want to capture the data. The final script step uses Exit Script [false] so that the triggering keystrokes do not effect anything.
The second script use an OnObjectExit trigger to do something like what your script does to process the scanned data.
um...ok, i kind of get what you are saying, I mean it all makes sense...but could you break it down with sudo code/text for me so I can see the steps. I need to picture this 3D in my head, I'm sure you know what I mean. hehehe
Copying and pasting from a database design report where we scan data from driver's licenses. (MSR scanners work much like bar code scanners.)
If [ Get ( TriggerKeystroke ) = "~" and Get ( TriggerModifierKeys ) = 3 /* Modifier 3 means shift and capslock are down */ ]
Go to Object [ Object Name: "Scan Box" ]
Exit Script [ Result: False ]
I use Go To Object here because this layout has two copies of the field and I want the cursor in 2 pixel copy to keep the scan process invisible.
Go To Object did the trick! Once again thank you TONS Phil. Not to mention telling me about the variable bug, I would have been wracking my brain all night. =)