7 Replies Latest reply on Aug 28, 2014 6:55 AM by philmodjunk

    Filemaker Pro 13 Popup Menu Bug (Record Load Trigger)

    ezz

      Summary

      Filemaker Pro 13 Popup Menu Bug (Record Load Trigger)

      Product

      FileMaker Pro

      Version

      13

      Operating system version

      Windows

      Description of the issue

      Popup Menus open and values can be changed in a Popup Menu before the Record Load event/trigger completes.

      Steps to reproduce the problem

      - List View with at least 3 records
      - Record load trigger to set a variable of the fields original value (on record load) and before any data is modified;
      - Change value of popup menu in one record;
      - Click directly on the popup menu in another record (thus changing records by clicking on the popup menu in an alternate record - the popup menu opens and the value can be changed before the record load trigger script completes for the newly selected record thus loading the new value into the variable instead of the original value before it was changed).
      - Repeat with subsequent records (bug may only happen on second and subsequent record changes and not the first time).

      Expected result

      The record load trigger and script should complete before data in the popup menu field can be modified.

      Actual result

      Data can be changed in the Popup Menu list before the record load trigger and script that references the 'load state/value' of such field competes causing incorrect load state value to be read from the popup menu field.

      Exact text of any error message(s) that appear

      None

      Workaround

      Use a drop down list instead of a popup menu (the drop down arrow does not appear until after the record change and after the record load event completes like other fields.

        • 1. Re: Filemaker Pro 13 Popup Menu Bug (Record Load Trigger)
          TSGal

               Ez Z:

               Thank you for your post.

               Our Development and Testing departments are already aware of this issue with OnObjectLoad and OnObjectEnter.  In essence, the record is not activated until the Mouse Up action.  With a Pop-up menu, the mouse down activates the entry, and the entry is not saved until the mouse up action.

               I have attached your post to the original report.  When more information becomes available, I will let you know.

               TSGal
               FileMaker, Inc.

          • 2. Re: Filemaker Pro 13 Popup Menu Bug (Record Load Trigger)
            ezz

                 Thanks for the reply. Yes, on further logging of the events order in this case a move from popup menu to popup menu across records fires as follows:

                   
            •           (Record 1) Object Exit
            •      
            •           (Record 1) Record Commit (if modified)
            •      
            •           (Record 2) Popup opens (and data can be changed)
            •      
            •           (Record 2) Record Load
            •      
            •           (Record 2) Object Enter 

                  

                 It should occur as per other fields in this order:

                   
            •           (Record 1) Object Exit
            •      
            •           (Record 1) Record Commit (if modified)
            •      
            •           (Record 2) Record Load
            •      
            •           (Record 2) Popup opens (and data can NOT be changed)
            •      
            •           (Record 2) Object Enter 
            •      
            •           (Record 2) Popup active (and data can be changed)

                  

                 Or I suppose:

                   
            •           (Record 1) Object Exit
            •      
            •           (Record 1) Record Commit (if modified)
            •      
            •           (Record 2) Record Load
            •      
            •           (Record 2) Object Enter 
            •      
            •           (Record 2) Popup opens (and data can be changed)

                  

                 In summary. until rectified... script logic that references a fields value using the on record load trigger in a popup menu may reference a changed value and not the original value expected causing incorrect logic to be applied.

                  

            • 3. Re: Filemaker Pro 13 Popup Menu Bug (Record Load Trigger)
              philmodjunk

                   One work around for popup menus is to use the OnRecordEnter trigger and pass the value of the field to the triggered script as a script parameter. The value then returned by the script parameter will be the original value of the field.

              • 4. Re: Filemaker Pro 13 Popup Menu Bug (Record Load Trigger)
                ezz

                     Thanks for your input Phil... OnRecordEnter? Did you mean OnObjectEnter?

                      

                     If OnObjectEnter then perhaps with some extra logic this might work but I see a few pitfalls in doing so vs just swapping out for a Drop down menu instead. For one immediate example, the OnRecordLoad event actually reads 4 different fields 'original' values just 'once' into variables at the start of any record selection (load). Using OnObjectEnter in addition for the popup menu will result in the event triggering every time the popup field is entered and its value modified. So the first time upon record selection (load)+(objectenter) it may read the original value but if they move to another field on the same record and back again to alter the value again it will read the modified value thus loosing the actual 'original' value. Of course this could be trapped in code for first time vs subsequent modifications in OnObjectEnter hence the extra code to workaround the workaround.

                      

                     Or am I missing something or not understanding your concept properly?

                • 5. Re: Filemaker Pro 13 Popup Menu Bug (Record Load Trigger)
                  philmodjunk

                       Yes, OnObjectEnter.

                       You are understanding the basic idea. It can't be used in many situations, but works well when it can be used. Much depends on what you need to do with the original value of the field. In many cases, you just want to use it to revert the value when the focus exits the field and then you don't need to worry about the issues that you've posted.

                  • 6. Re: Filemaker Pro 13 Popup Menu Bug (Record Load Trigger)
                    ezz

                         Thanks Phil...

                          

                         It appears that (as you describe) by passing the field values as script parameters into the main script from either OnObjectEnter or OnRecordLoad vs reading the values once in the main script works around this issue.

                          

                         My curious side still wants to understand why that works though (why do the parameters of a script call get assigned into memory before the actual event completes for the same)... it appears then that the order of things is as follows:

                          

                           
                    •           (Record 1) Object Exit
                    •      
                    •           (Record 1) Record Commit (if modified)
                    •      
                    •           (Record 2) Record Load - ScriptParameter Evaluated
                    •      
                    •           (Record 2) Record Enter - ScriptParameter Evaluated
                    •      
                    •           (Record 2) Popup opens (and data can be changed)
                    •      
                    •           (Record 2) Popup closes
                    •      
                    •           (Record 2) Record Load - Script Evaluated
                    •      
                    •           (Record 2) Object Enter  - Script Evaluated
                    • 7. Re: Filemaker Pro 13 Popup Menu Bug (Record Load Trigger)
                      philmodjunk

                           Since neither you nor I have access to the source code, we can only guess. My guess is that the script parameter expression evaluates before the user can mouse click on a value in the deployed value list. I'm just glad an experiment I did when LaRetta first reported this issue worked the way it did.