Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4097 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I've run across a really odd situation and wanted to see if anyone else has either experienced the same, or can provide a solution.

A field on a List View layout has the OnObjectKeystroke script trigger. The script checks the Get ( TriggerKeystoke ), and will either go the next record or the previous one if the appropriate key was typed. Works perfectly fine when using the keyboard, but when I use a scanner, every time not all of the symbols come through into the field. It appears that the system isn't able to handle the scripting and all of the characters in such a rapid succession. When I take the script trigger off, then all of the scan shows up in the field.

The original intent of this to be able to scan barcodes in rapid succession into already existing records, without the user having to navigate using the keyboard/mouse. In my specific situation, the scanner is sending the CR code as a suffix, and FM is using that as a trigger to go to the next record.

The funny thing is that this setup worked perfectly fine in FM11. :getlost: Something has changed with FM12, but I haven't been able to find anything confirming this. It's like some kind of background process is delaying the scripting enough to cause problems. I originally thought that it might have something to do with the layout conversion from 11 to 12, but even building up a brand new layout/script gives the same results. It doesn't matter what computer I use this on or what type of barcode scanner, so it's definatly a problem with FileMaker.

I've tried to program other methods to get this functionality to work, but have failed so far. Any ideas??

  • 3 weeks later...
  • Newbies
Posted

Yup, got the same thing. I wrote a 4 line trigger script and it failed using both a mag stripe reader and bar code reader.

I called FM support, but they are claiming that they do not support 3rd party devices. I can actually make it happen when I very quickly run my finger across a row of keys on a regular old keyboard.

I don't get why it doesn't work correctly since the standard size of the keyboard buffer in the operating system on most machines is 100 characters...way above what a barcode scanner puts out on a single read.

I have a workaround that is good for some problems, but not all. The workaround does a one second pause in a loop after setting up the data. After each second, the loop code checks to see if there are any interesting characters in the input field from a bar code reader or mag stripe reader. If there is, it exits the loop and sets a variable with an indication of what caused it to exit, else it continues to do its 1 second pause in the loop. The problem with this is if a termination character never comes up, it will loop forever. It wouldn't be too hard to put a timeout in the loop by counting the loop iterations and exiting the loop after a certain number of iterations. Hope this helps...

This does not solve all the problems, though. We have our barcode readers programmed with a preamble that I pick off in a layout trigger (OnLayoutKeystroke) that looks at every character. If it finds the preamble, it knows it's a UPC and makes an item entry. The timeout loop could work for this but it would be very messy.

Please keep me posted if you find any workaround and I'll do the same.. For me, it would be lots of rewriting and also a loss of functionality, as far as I can figure.

  • Newbies
Posted

First time poster, but have gathered so much information from all of you over the years I am happy to be able to provide some information. We have a bar code scanner that we use to track the members as they enter our facility. Used OnObjectModify (or OnObjectKeystroke can't remember) script trigger in FM 11 for two years without a glitch. Converted to FM 12 and couldn't get it to work. Same problem, would only read some of the numbers.

Just through trial and error realized if I switched the script trigger to be OnObjectSave and added a "tab" to the end of what the bar code sends it worked great. Hopefully this works for all of you.

Posted

I have the same behavior, but only on windows (on Mac this still works fine).

Adding a global field (and set Enter and Return as going to next field) and OnObjectSave was the workaround.

Posted

I'm glad to hear I'm not the only one experiencing this. I've already submitted a bug report to FileMaker Inc. but they'll probably ignore it. The only possibility that I can think would cause this is the additional event handling that FM now has to do in v12.

The workaround that I found to work was the same thing andries suggested. Most scanners you can program to put a carriage return (character #13) after the number scan (if it isn't that way by default), which will trigger going to the next field. But this restricts the script from evaluating a single character at a time, which is upsetting.

  • 11 months later...
  • Newbies
Posted

I found this out to my peril as well this week.

 

Our EPOS system which we have written in house suffered the same problem after converting to FM12 

I've changed the global field script trigger from onObjectKeystroke to onObjectSave

This works but remember that whatever script you call you will need a way to exit it (or everytime to try to move out of the field you will trigger the script and probably bring focus back to your original field - as with our EPOS where you want to scan multiple times!)

 

Remeber you can cancel the scriptTrigger effect with an exit script 1 or 0 depending on your desired outcome.

 

http://www.filemaker.com/11help/html/script_trigg.38.6.html

This topic is 4097 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.