9 Replies Latest reply on Aug 11, 2012 12:59 PM by

    Help troubleshooting fmp7script URL scheme failures in a multi-user setup

    jdornbos

      Title

      Help troubleshooting fmp7script URL scheme failures in a multi-user setup

      Post

      I have been using the url scheme fmp7script with CNS Barcode scanning software on iPad 2s in combination with a FMP 11 database hosted on a macbook. During setup, with one ipad, everything works as expected - the database is open and shared on the mac, the ipad has the database open in FM Go, they hit the button to scan the barcode and are taken over to CNS Barcode to scan, the scanner beeps indicating a successful scan, returns them to the database and populates the field with the barcode value. All is good.

      Add a second or more ipads and the execution of the fmp7script step starts becoming unreliable. Instead of populating the field with the barcode value, FM Go thinks for 10 seconds or so after the scan, like it's trying to figure out where to go, then I am returned to the database, to the same screen, but the return script is never fired. If I hit the button to scan a second time, it will reliably scan and record the value correctly. With multiple iPads connected, sometimes it will scan on the first try, other times it requires the second scan.

      In running through the troubleshooting, I have updated all copies of FM Go, FMP and CNS Barcode to the latest versions. I also installed and tested pic2shop pro as the barcode scanner. That behaves exactly the same as CNS Barcode - reliable until multiple ipads are in use. I also installed FM Server for testing purposes - hosting the database there instead of FM Pro - to eliminate questions about number of users connected to the database - and had the same results.

      I'm getting to the point where I'm out of things I can think of to test. It appears that with a shared database, there's a problem with using the fmp7script scheme. Any suggestions - either on how to fix the problem or how to get that scanned barcode value stuffed into my database.

       

      TIA

      Jim

        • 1. Re: Help troubleshooting fmp7script URL scheme failures in a multi-user setup
          TSGal

          Jim Dornbos:

          Thank you for your post.

          Perhaps you could post the entire script so I can understand what the script is doing.  You may also want to check with the makers of CNS Barcode to see if any other FileMaker users have reported problems.

          TSGal
          FileMaker, Inc.

          • 2. Re: Help troubleshooting fmp7script URL scheme failures in a multi-user setup
            jdornbos
            I have talked with  the CNS Barcode folks. The scanning portion of the process appears to be working correctly. The scanning software launches, sees the
            barcode, beeps, indicating a successful scan, then I am getting back to the FM database fine. But the script contained in the fmp7script: instruction is 
            unreliable in firing. I added several Show Custom Dialog (Steps 1-4), but when it's having troubles, the script that calls them never gets launched. 
            I end up sitting back in the database, on my "scan certificate" screen with no value copied over - no custom dialog box appears indicating the script launched.
             
            My original FMP scan script is: 
            Open URL [No dialog; "cnsbarcode://scan?profile=DT01&method=camera"]
             
            In CNS barcode, the profile DT01 is set to perform this action when a scan is complete:
            fmp7script://$/My_Demo_Tour.fp7?script=scan_return&param=::barcode::
            To eliminate the CNS barcode profile, I have changed my FMP scan script to contain the complete instruction:
            Open URL [ "cnsbarcode://scan?method=camera&launchurl=fmp7script://$/My_Demo_Tour.fp7%3fscript%3dscan_return%26param%3d::barcode::" ]
            [ No dialog ]
             
            When testing pic2shop PRO, my FMP scan script is:
            Open URL [ "p2spro://scan?callback=fmp7script%3A//%24/" & Get(FileName) & "%3Fscript%3Dscan_return%26param%3DCODE" ]
            [No dialog ]
             
            The scan_return script that catches the results of either scan is:
            Show Custom Dialog
            [ Title: " Step 1"; Message: "Found the scan_return script. Keep going."; Buttons: “OK” ]
            If [ Get(ScriptParameter) = "::CANCELLED::" ]
            Exit Script [ ]
            End If
            Show Custom Dialog
            [ Title: " Step 2"; Message: "Scan value was not ::Cancelled::. BARCODE value is: " & Get(ScriptParameter) & ". Keep going."; Buttons:“OK”, “Cancel” ]
            If [ Get(LastMessageChoice) = 2 ]
            Exit Script [ ]
            End If
            Set Field
            [ Demo_Tour::rCertificate_Number; Get(ScriptParameter) ]
            Show Custom Dialog
            [ Title: " Step 3"; Message: "copied the value " & Get(ScriptParameter) & " into the rCertificate_Number field."; Buttons:“OK” ]
            If [ Demo_Tour::rCertificate_Number = "" ]
            Show Custom Dialog
            [ Title: "Please enter a value"; Message: "Please enter your certificate number before pressing the button."; Buttons:“OK” ]
            Exit Script [ ]
            End If
            Show Custom Dialog
            [ Title:
            " Step 4"; Message: "rCertificate_Number must not be empty - proceeding to mark field ready to send."; Buttons:“OK” ]
            Show Custom Dialog
            [ Title: "Success!"; Message: "Your certificate number has been successfully recorded and will be active in 30 mintues."; Buttons:“OK” ]
            Set Field
            [ Demo_Tour::rCertNeedtoSend; "1" ]
            Go to Layout [ “main_EN” (My_Demo_Tour) ]
             
            • 3. Re: Help troubleshooting fmp7script URL scheme failures in a multi-user setup
              TSGal

              Jim Dornbos:

              I apologize for the late reply.

              What part of the script fails?  Do you get the scan in the initial script (Open URL)?

              Does the scan complete and you get the proper URL to display?

              Does the custom Dialog "Found the scan..." display?

              What dialogs don't display?

              TSGal
              FileMaker, Inc.

              • 4. Re: Help troubleshooting fmp7script URL scheme failures in a multi-user setup
                jdornbos

                In all cases, I make it to the barcode scanning software and get a beep indicating a successful scan. In all cases, I am returned to the database in filemaker go. Where it's failing is the return script doesn't always fire. When it works, all the dialogs display and the certificate number gets populated. When it doesn't work, I don't even get the first "Found the scan..." dialog to display.

                • 5. Re: Help troubleshooting fmp7script URL scheme failures in a multi-user setup
                  TSGal

                  Jim Dornbos:

                  Thanks for the update.

                  It sounds like everything is working except the return script.  What ooptions do you have to trigger the return script?  If the scan is successful, where are the contents loaded?  You mentioned in the original post that the "scan certificate" screen contains no value, which I'm assuming the script trigger would not fire.  What is involved in getting the scan value copied into the database field?

                  TSGal
                  FileMaker, Inc.

                  • 6. Re: Help troubleshooting fmp7script URL scheme failures in a multi-user setup
                    jdornbos

                    CNS Barcode looks for the ::barcode:: value in the return URL (shown below) and replaces it with the value of the scan.

                    fmp7script://$/My_Demo_Tour.fp7?script=scan_return&param=::barcode::

                    In the scan_return script, I use a Set Field step to assign the script parameter to the Certificate Number field. Before exiting the script, I check the value of Certificate Number. If it's not empy, I call it good and move on. If it is empty, the script complains.

                    The problem is that the script "scan_return" doesn't get run. I can change the script so that all it does is display a custom dialog box that says "Hi TSGal". When I hook more than 1 ipad up to the database, the running of that return script becomes unreliable - sometimes it will get run when control returns to filemaker, sometimes it won't get run.

                    Thanks for continuing to poke at it.

                    Jim

                    • 7. Re: Help troubleshooting fmp7script URL scheme failures in a multi-user setup
                      TSGal

                      Jim Dornbos:

                      I'm still trying to determine where the script is failing.  Can you confirm there is a ::barcode:: value?  The "fmp7script" URL is not executing, or is it executing without a value?  If the value is empty, what steps are you taking to grab the value again?  It sounds like this is a hosted solution.  Correct?  Is the host running FileMaker Server or FileMaker Pro?  How many guests are accessing the file?  How many FileMaker Go users are accessing the file?

                      TSGal
                      FileMaker, Inc.

                      • 8. Re: Help troubleshooting fmp7script URL scheme failures in a multi-user setup

                        I think you are facing a problem of use a script and converting optional English or Chinese into French...

                        Go back to basics and use the script that works for CNS barcode inside one script that only handles CNS barcode.

                        Then use a script that works only with pic2Shop.

                        Both apps have sample scripts that work and it is only sensible to use them in their working form rather than spend hours or days making working scripts not work. One of the easiest things in the world to master is the ability to break a working script. Do it all the time. Never learn...

                        Use a button for CNS barcode attached to its script.

                        Use a button for pic2shop attached to its script.

                        Or you can use a dialog to select CNS or pic2shop but don't mix up their Open URL code, that doesn't work any more than trying to mix up your english, french and chinese.

                        • 9. Re: Help troubleshooting fmp7script URL scheme failures in a multi-user setup

                          You need to "install" a profile in CNS barcode. This app has pretty extensive settings, which you could get confused in.

                          I had the same problem that their sample DB was working, but my script did not.
                          It was related to the fact that you need to create a profile in CNS barcode (can be done via OpenUrl) and that is where you really set the return script.

                          So, your problem is really not related to FMGO, but you need to read the cns barcode manual and check out their sample db.

                          Btw, CNS barcode is a great app, as it allows for both single and multi scan. So If you need to scan a range of barcodes, you could batch that in cns and after the last one, you press done and all the barcodes are sent back to fmgo, where you can process them.

                          If you only need to scan single barcodes, meaning one at a time, you could choose ScannerGO, which is free (I belive). It works very simple, with the url.

                          This is my "proof of concept" url that I run in order to install a profile in cns barcode:

                          "cnsbarcode://addprofile?name=barebones_multi&launchurl=fmp7script://$/" & Get ( FileName ) & "%3fscript%3dMulti_Scan_Return&scanmultiple=yes&scanreturnerrors=yes"