14 Replies Latest reply on Mar 19, 2012 12:20 PM by MicheleOlson

    Script failing on one Mac

    MicheleOlson

      A script that generates an invoice has started failing within the past 10 days. We've been able to trace the failure to a single computer. [iMac, less than 1 year old, Mac OS X 10.6.8, FMP 11.0v4].

       

      The portion of the script that is failing is the assigning of the invoice number. Here are the steps that fail:

       

       

      Set Variable [ $lastNum; Value:Max(ord_ORD__maxInvNum____oneKey::Invoice#) ]

      Set Field [ ORD__entry__tog::Invoice#; $lastNum + 1 ] "

       

      There are 4 other computers in the office, all running the same system and all invoicing.

       

      On each of the others, the invoice # is updated and set properly, while it fails on this computer.

       

      I have had the user log in as herself on another computer and test, the script does not fail.

       

      It appears to me that FileMaker on the failing computer is off. Other than trashing FM preferences ... and if that does not solve it, reinstalling FM ... are they any other ideas about what may be causing the issue?

       

      There have been no changes [updates to system, new apps, etc.] to this computer for well over a month.

       

      Thanks for your ideas.

       

      Michele

        • 1. Re: Script failing on one Mac
          cgabby

          How is it Failing? is it assigning a invoice number that another person has already assigned to an invoice?

          If so, what could be happening is if two people clink the button to at the same time or before one of them commits their record, they would both get the same ID number. Have you thought about using the “Serial Number” auto-enter feature in FileMaker? As you get more records in the Invoice table the “Max” function will start to take longer to calculate.

           

          Christopher Gabbert

          1 of 1 people found this helpful
          • 2. Re: Script failing on one Mac
            Stephen Huston

            Hi Michele,

             

            I assume this is a served solution, which means that your relationship for setting the variable is requiring the caching of all record data from the source table, which may be huge.

             

            If that computer is trying to execute the Set Field step before tha cahing is complete, it may fail at that step.

             

            Try inserting a 1 second pause between the two steps you showed, and see if intentionally slowing down the script allows the variable to set properly.

             

            I have also seen instances where wireless or other WAN connections have required even longer for full-table caching, and in those cases I implement a loop between the steps to test that the value has been set to an acceptable number before exiting the loop (with a pause in it) so the next step can perform.

             

            We have one WAN connection between cities which requires up to 90 seconds for caching for one WAN user, and the looped pause is the only thing which allows the network connection time to execute during the script.

             

            Not pretty, but better than failing.

             

            Stephen Huston

            1 of 1 people found this helpful
            • 3. Re: Script failing on one Mac
              MicheleOlson

              Hi Christopher,

               

              The failure is in assigning the invoice number. No number is assigned. All other portions of the script operate as they should, except on the computer in question, the invoice# is not recorded.

               

              Invoice #'s are assigned to orders at the time the order ships, not when the order is generated. For this reason we use a method that determines the highest # and adds 1, rather than an auto-entered serial #.

               

              It is rare, if ever, that two people would be invoicing at the same time, so I don't believe that to be the issue.

               

              Your comment on the Max function is well taken, but there does not appear to be a slow down with this. The table has over 28,000 records at this time.

               

              Since the staff person was able to login to two different computers and invoice with no problem, I keep coming back to there is something amiss on her computer.

               

              Thanks,

               

              Michele

              • 4. Re: Script failing on one Mac
                ariley

                Michele,

                 

                Have you debugged the script on the Mac? You may want to replace the serial number with a variable first so you can see whether you can generate the serial number. 

                 

                Best,

                Agi

                 

                agnes b. riley . filemaker and web development

                FileMaker Business Alliance . FileMaker Technical Network

                www.zerobluetech.com (http://www.zerobluetech.com)

                 

                 

                T 201-299-6223 (NJ) .

                212-842-8830 (NY)

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                .

                917-660-7221 (C)

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                FileMaker Certified in 10 and 11

                people + products + events + todos + invoices + documents = productivity

                • 5. Re: Script failing on one Mac
                  MicheleOlson

                  Hi Stehen,

                   

                  Yes, it is a served solution [FMS 11].

                   

                  I considered a caching situation initially and added a commit record step thinking perhaps that was not occurring.

                   

                  The other consideration is that this is a new installation of FMS 11 on a new MacPro [2 weeks ago]. I don't know if that is a factor, but that is the only *new* item to their network or system.

                   

                  I'll try the Pause step to see if that makes a difference.

                   

                  Thanks.

                  • 6. Re: Script failing on one Mac
                    ariley

                    I doubt it is the fact that it's a new Mac. There could be an issue with a hub or switch from the Mac to the server, but please debug carefully. Maybe you need to put in a 0.2 sec pause somewhere.

                     

                    agnes b. riley . filemaker and web development

                    FileMaker Business Alliance . FileMaker Technical Network

                    www.zerobluetech.com (http://www.zerobluetech.com)

                     

                     

                    T 201-299-6223 (NJ) .

                    212-842-8830 (NY)

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                    .

                    917-660-7221 (C)

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                    FileMaker Certified in 10 and 11

                    people + products + events + todos + invoices + documents = productivity

                    • 7. Re: Script failing on one Mac
                      MicheleOlson

                      Hi Agi,

                       

                      Yes, I've debugged in both my office and at theirs, using FMPA in both instances. The variable does fill with the last used invoice # in both cases. [It is an all Mac business and my development environment is Mac.]

                       

                      I just can't tell if the variable fills on her computer because only FMP is installed there. [Idea ;-) --> I could add a few steps to show a dialog with the variable entry so I can see what is happening on her computer. I may try that if trashing prefs doesn't do the trick.]

                       

                      The invoice# does not fail to assign on the other 4 computers in the office. Only on the one. And it only started happening in the past week to 10 days.

                       

                      The script has worked for many years with no failure.

                      • 8. Re: Script failing on one Mac
                        ariley

                        Download a trial for FMPA, and debug on her Mac. Also, check with networking guys to test the network or her network card. 

                         

                        Unfortunately, temperamental errors are the hardest to troubleshoot. 

                         

                        agnes b. riley . filemaker and web development

                        FileMaker Business Alliance . FileMaker Technical Network

                        www.zerobluetech.com (http://www.zerobluetech.com)

                         

                         

                        T 201-299-6223 (NJ) .

                        212-842-8830 (NY)

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                        .

                        917-660-7221 (C)

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                        FileMaker Certified in 10 and 11

                        people + products + events + todos + invoices + documents = productivity

                        • 9. Re: Script failing on one Mac
                          MicheleOlson

                          Nice idea, Agi. But... I don't believe you can download a trial version of FMPA. Only FMP.

                           

                          If you have a site for a download for FMPA, let me know. That is a very good idea.

                          • 10. Re: Script failing on one Mac
                            ariley

                            Sorry. Then just install a regular copy with your license and remove it when done testing.  

                             

                            agnes b. riley . filemaker and web development

                            FileMaker Business Alliance . FileMaker Technical Network

                            www.zerobluetech.com (http://www.zerobluetech.com)

                             

                             

                            T 201-299-6223 (NJ) .

                            212-842-8830 (NY)

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                            .

                            917-660-7221 (C)

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                            FileMaker Certified in 10 and 11

                            people + products + events + todos + invoices + documents = productivity

                            • 11. Re: Script failing on one Mac
                              timwhisenant

                              Michele,

                              Can you return to the screen the value of $lastNum? If this is a new mac could field typing be the problem? Variables are type text by default, maybe if you could insert the show dialog step between the the two steps in question you can find if both fail or only one is failing.

                               

                              Just another idea.

                              Tim

                              • 12. Re: Script failing on one Mac
                                ch0c0halic

                                Michele may have assigned her last number,

                                 

                                Sorry Michele, I wouldn't do it that way. Could be a big problem if two people ever do assign an invoice number at the same time. You could easily get a duplicate.

                                 

                                Your testing so far shows this is only happening on the one comptuer. Did you reproduce the error or was it the end user reporting it? That seems to indicate something about that computer. Or something about the user on that computer that is differet. Perhaps when on that ocmputer the user feels more comfortable and reverts to a 'workflow habit' that you do not see when you are watching or when using a different comptuer.

                                 

                                However, to troublehsoot this issue I'd try a few things.

                                Two potential problems:

                                1. Number is not being returned in variable.

                                2. Field is not being set.

                                 

                                1. Log the valriable/record ID. Create a log table and a logging script to store the current record ID and the invoice number variable, timestamp, maybe some other stuff too. This problem may be happening more often than the customer is reporting and they may have developed some kind of work-around for it whithout telling you.

                                2. Could be this user typically has the record open in a different window when running this script. Turn off error capture before the set field step that appears to be failing. User should report if/when it happens.

                                3. You've probably stepped thru the script on that computer and its worked. There may be a timing issue. Is the value not returned or is the field not being set?

                                Add a Commit after the set field and then a pause step (just for testing, disable or remove when done). See if the value is in the field and review the Variable in the data viewer.

                                 

                                3rd possability: Field is getting cleared afterwards due to some error coding?

                                 

                                My solution:

                                To clean this up and remove the potential duplication issue I'd redesign using a separate invoice number table with an auto-enter Serial Number for the invoice number. Creating a new record incriments the serial number and entering the record id of the original order provides a trace of which order got which invoice number. I've not seen the auto-enter serial on record creation fail in a Multi-user environment.

                                • 13. Re: Script failing on one Mac
                                  MicheleOlson

                                  Tim,

                                   

                                  That was the idea I had within my message to Agi. I will try that onsite tomorrow.

                                   

                                  Thanks.

                                  • 14. Re: Script failing on one Mac
                                    MicheleOlson

                                    ch0c0halic may have a sweet idea....

                                     

                                    Thanks for the reply and for all the methods of testing, ch0c0. I believe you are right. It is time for a new method of invoice # assignment.

                                     

                                    Best,

                                     

                                    Michele