10 Replies Latest reply on Mar 17, 2016 11:26 AM by googull

    set field inconsistently failing in 14.0.5 - why?

    googull

      I am running FMP Adv 14.0.5  - since last update I have started having issues with fields failing to be set under script control on desktop app.    This wasn't an issue before by now it is happening repeatedly though and I can't replicate on command.  My client runs all day then calls to report missing data that never used to be an issue.   3 of these issues are from scripts I have written but also from a Set Field script in the Invoices template.   Sending and invoice via email has always marked the invoice as sent.  Last week 37 invoices were sent and the script failed to update the table.  Since then all good.   I am reordering script statements and placing commit statements behind every Set Field - trying to address this inconsistent behavior.  Fields being impacted are in various tables.  When I test myself everything works.  Wondering if anyone has seen this come up or might have a idea on what might have changed other than the recent FMP update.

       

      Thanks

      Carl

        • 1. Re: set field inconsistently failing in 14.0.5 - why?
          siplus

          Create a log table, after the set field set a $var to Get(LastError) and if it's different from 0 create a log entry in the log file.

          1 of 1 people found this helpful
          • 2. Re: set field inconsistently failing in 14.0.5 - why?
            BeatriceBeaubien

            Hi Carl,

             

            This is a long shot, but do the offending scripts set fields from variables? If so, are they local and/or global variables?

             

            Also, what version were you running before 14.0.5? What version is your client running?

             

            Best wishes,

             

            Beatrice

             

            On Mar 14, 2016, at 14:42, googull <noreply@filemaker.com> wrote

             

                                      

            set field inconsistently failing in 14.0.5 - why?

            created by googull in Discussions - View the full discussion

             

            I am running FMP Adv 14.0.5  - since last update I have started having issues with fields failing to be set under script control on desktop app.    This wasn't an issue before by now it is happening repeatedly though and I can't replicate on command.  My client runs all day then calls to report missing data that never used to be an issue.   3 of these issues are from scripts I have written but also from a Set Field script in the Invoices template.   Sending and invoice via email has always marked the invoice as sent.  Last week 37 invoices were sent and the script failed to update the table.  Since then all good.   I am reordering script statements and placing commit statements behind every Set Field - trying to address this inconsistent behavior.  Fields being impacted are in various tables.  When I test myself everything works.  Wondering if anyone has seen this come up or might have a idea on what might have changed other than the recent FMP update.

             

            • 3. Re: set field inconsistently failing in 14.0.5 - why?
              googull

              Thanks Si - I am logging like crazy. 

               

              In response to Beatrice:

              The inconsistent set field commands are $$Global Variables and Calculated results  - e.g. get(current date).

              Client and I are in Sync - I installed their own license of ADV on their primary testing machine just to be sure. 

              Prior version was the 14.0.4.406

              • 4. Re: set field inconsistently failing in 14.0.5 - why?
                BeatriceBeaubien

                Hi Carl,

                 

                As the update was from 14.0.4.406, I am not sure this is relevant, but have a read of the following thread.

                https://community.filemaker.com/message/541934?et=watches.email.thread#541934

                 

                The suggestion was to use a global field, rather than a global variable.

                 

                There is also another thread, but I can't find it at the moment.

                 

                Best wishes,

                 

                 

                Beatrice

                 

                On Mar 14, 2016, at 16:26, googull <noreply@filemaker.com> wrote

                 

                                          

                set field inconsistently failing in 14.0.5 - why?

                reply from googull in Discussions - View the full discussion

                 

                Thanks Si - I am logging like crazy.

                 

                 

                In response to Beatrice:

                 

                The inconsistent set field commands are $$Global Variables and Calculated results  - e.g. get(current date).

                 

                Client and I are in Sync - I installed their own license of ADV on their primary testing machine just to be sure.

                 

                Prior version was the 14.0.4.406

                 

                • 5. Re: set field inconsistently failing in 14.0.5 - why?
                  googull

                  Beatrice - that post you reference was very helpful.  Clear for the time being to avoid setting fields values from variables.   A rather a dramatic flaw that I hope will be addressed.   The recommendation was to reorganize around Global Fields instead of Variables which doesn't seem ideal for scripting for several reasons:


                  1. A Set Field command is needed to assign the Global Field a value in the first place.


                  2. Layout Objects with a Perform Script Action that use an optional script parameter need to be converted into yet another  named script cluttering up the Script List.  In my case, this would be dozens of 2 line scripts that simply set the Global Field then call the destination script.


                  So instead of re-designing around global fields I simply added If/then tests to decode global fields into literals when needed for Set Field assignments and thus far this is proving reliable.  Set Field [ TABLE::FIELD ; "LITERAL" ]


                  I still have not figured out a how to address the following inconsistent Set Field assignment beyond error logging (none so far) and adding additional logic testing to ensure a successful assignment is made.


                  Set Field [ TABLE::TS_FIELD ; Get (CurrentTimestamp) ]


                  Carl

                  • 6. Re: set field inconsistently failing in 14.0.5 - why?
                    siplus

                    If your solution is hosted, use

                     

                    Set Field [ TABLE::TS_FIELD ; Get ( CurrentHostTimestamp ) ]

                    1 of 1 people found this helpful
                    • 7. Re: set field inconsistently failing in 14.0.5 - why?
                      brianc

                      It is worth noting that using Get (CurrentHostTimestamp) works even if the file is not hosted. If the file is open locally, it considers the local machine to be the 'host'. I rarely use get(CurrentTimestamp) unless I need to know if there is a difference between the server and the client.

                      • 9. Re: set field inconsistently failing in 14.0.5 - why?
                        BeatriceBeaubien

                        Let's try that again.

                         

                        Hi Carl,

                         

                        I'm glad the reference proved useful and that your work around seems reliable. It is a nuisance to have to set fields rather than storing them in variables and to add cruft to the Script List, but at least the problem is partially resolved.

                         

                        I suspect the problem you and others have experienced arises from an obscure timing error/bug somewhere in the application.

                         

                        Did the suggestion of using the Get(CurrentHostTImestamp) help?

                         

                        Beatrice

                        • 10. Re: set field inconsistently failing in 14.0.5 - why?
                          googull

                          Because I moved all the Set Field; Get() assignments and placed a commit after each one of them and added If/then test logic to ensure result as well as general error logging, I have not yet flipped over to the alternative CurrentHostTimestamp vs CurrentTimestamp.   I have had issues with both Get(CurrentTimeStamp) as well as Get(CurrentDate) and so I my suspension is not specific to the CurrentTimeStamp command, but rather, the Set Field command, especially in light of the challenges I encountered with the use of variables.   As you suggest, the sporadic nature of the fault does seem like something that  could be due to timing fluctuations.

                           

                          Carl