3 Replies Latest reply on Jan 7, 2013 8:32 AM by philmodjunk

    Field navigation and script triggers

    K.Feete

      Title

      Field navigation and script triggers

      Post


           Hi all.

           I'm trying to set up a slightly complicated inventory system using a barcode scanner and Filemaker 11. For each item there are four scans to be made, identifying the location the item came from, where it's gone to, the item, and the quantity. This is all being done by a nifty little Intelliscanner which gets carted around and plugged in at the end of the day, dumping a load of scans into my Movement Records layout at once.

           Now so far this is working. However, I figure it's only so long before someone forgets to do one of those four scans and throws all the data off, so I was trying to run OnExit script triggers in each field that looked at the data, saw if it was in the wrong field, and moved it to the right one. This also works, but, if the script excutes (eg if it finds data in the wrong field and moves it), the buck stops there -- the cursor stays in the new field. So the next scanned barcode gets dumped into the wrong field, thus worsening the problem I was hoping to solve.

           I first tried to fix this by adding a Go To Object command, then mucked about a bit with Exit Script. No dice; the cursor stubbornly stays in the field it has just moved data to. I assume it has something to do with the script triggers piling up, since I have one on each field, but that's as far as I got before getting stuck. These are the first scripts I've tried to write, and I think I'm in over my head.

           Help?

           (I've screenshotted the script that runs in the first two fields, in hopes that I've made some sort of obvious error....)

      Picture_1.png

        • 1. Re: Field navigation and script triggers
          philmodjunk

               You need to use Exit Script [False]

               to keep the triggering action from being processed and thus keep the cursor in the field where you have your script put it with either go to field, go to next field or go to object.

               You might also see if you can configure your scanner to append a character to the beginning of your scanned data. Then you can set up OnLayoutKeystroke to check for that keystroke and put the cursor in the correct field to recieve the scanned data.

          • 2. Re: Field navigation and script triggers
            K.Feete

                 Aaaaaah, I knew it was something simple! Thank you so much, everything is working perfectly now.

                 (I did consider the keystroke trigger option -- but I'm already having trouble with the scripts running too slowly for the rate at which the barcode scanner dumps, and I didn't want to have to slow things down even further.)

            • 3. Re: Field navigation and script triggers
              philmodjunk

                   We use that method, (an initial character on the beginning of the scanned data), with a magnetic script reader here and it works quite well with no noticeable slow downs.

                   The script is quite simple:

                   If [ Get ( Triggerkeystroke ) = "~" ]
                     Go to Field [Table::ScanField]
                      Exis Script [false]
                   End IF