9 Replies Latest reply on Jan 23, 2014 4:35 PM by philmodjunk

    FM13: Layout objects are not refreshed as expected when using Conditional formatting

    ScottBleackley

      Title

      FM13: Layout objects are not refreshed as expected when using Conditional formatting

      Post

           FileMaker Pro 13 advanced: Layout objects are not refreshed as expected when using Conditional formatting

           http://help.filemaker.com/app/answers/detail/a_id/10172/~/layout-objects-are-not-refreshed-as-expected-when-using-conditional-formatting

           Specifically, a portal tab label needs to turn blue or black depending on the value of a record.
           The value of the trigger records change appropriately, but the colour of the tab label does not.

           If I edit layout and return to non-edit mode, the colour is relative to the current value of the trigger records is then correct.

           I have tried placing a RefreshWindow into the script after leaving the portal entry that would trigger the change but no dice.

           Any suggestions are most welcome.

        • 1. Re: FM13: Layout objects are not refreshed as expected when using Conditional formatting
          philmodjunk

               If the value that affects the conditional format is in a field, you may need to commit records.

               I was able to add a button with this script:

               Set Variable [$$Color ; value: Not $$Color ]
               Refresh WIndow

               and then a conditional format expression of:

               $$Color

               worked to change the tab panel fill color. (This script toggles the value of $$Color back and forth between True and False.)

               If I gave the tab panel an object name, refresh object would also cause the color of the panel to update and this would seem a better option than refresh window.

          • 2. Re: FM13: Layout objects are not refreshed as expected when using Conditional formatting
            ScottBleackley

                 Thank you.  I understand that sometimes it works...  trying to fix it when it does not.
                 Any suggestions are most welcome.

                 I am highlighting a tab in blue when ( a or b ) and c is true

                 If I do just ( a or b ) it now highlights correctly as with your example above.
                 a and b are check boxes within a portal.  c on the other hand checks to see if a value exists within any record in a portal column.

                 There is a script trigger "On Save" for this column ( column 1 )  in the portal which refreshes the tab objects on this column, but it does not appear to help.

                 Conditional formatting for the tab is dependent on 
                 Form 2::Test of Range Indicators required = 1

                 Now I should note that this record "Form 2::Test of Range Indicators required" changes values correctly when appropriate values are selected in the portal column.  The conditional formatting on the tab does not change with the value.  It does change if I go in and out of edit mode.

                 Test of Range Indicators required 
                 is defined as follows: are either of the fields checked or does "livestock disturbance noted" appear in any record in this portal.

                 ( (not (IsEmpty ( Form 2::Community Watershed ))) or 
                   ( not (IsEmpty ( Form 2::Known Domestic Intake Downstream))) ) 
                 and
                   LiveStock Flag for Range Indicator
                  
                 LiveStock Flag for Range Indicator
                 is defined as 
                  
                 Sum ( Form 2 Data::livestock disturbance noted ) > 0
                  
                  livestock disturbance noted
                 is defined as
                  
                 If ( Column 1 = "livestock disturbance noted" ; 1 ; 0 )
            • 3. Re: FM13: Layout objects are not refreshed as expected when using Conditional formatting
              philmodjunk

                    I did make suggestion in my last post: Commit records may be needed to get things to update correctly on your layout.

              • 4. Re: FM13: Layout objects are not refreshed as expected when using Conditional formatting
                ScottBleackley

                     OK, Commit records.

                     If I commit records on modify of "column 1" which is from a user interaction point of view where it should be.
                     I appears to nullify, that is delete or erase, data from the menu pick for that field.

                     This happens if I trigger "On Save" or "On Exit Also"

                     Feel like I am missing the obvious today.

                     Any specifics would be most welcome.
                     Thank you

                      

                • 5. Re: FM13: Layout objects are not refreshed as expected when using Conditional formatting
                  philmodjunk

                       Commit records does not, by itself, erase data. I'd look for any other script triggers that your script might be tripping and interfering with the results that you expect to see. Commit Records can trip both OnObjectSave and OnCommitRecords triggers to name two possible issues.

                       This is an area where FileMaker Advanced becomes very valuable as you can enable the script debugger and then edit data on your layout. When a user action or script step trips a trigger, the trigger performed script will pop up in your debugger and you can step through the scripts one step at a time while watching your layout and the data viewer to see what changes at each point.

                       This can save many hours of sleuthing with the options available to you in FileMaker Pro.

                  • 6. Re: FM13: Layout objects are not refreshed as expected when using Conditional formatting
                    ScottBleackley

                         OK, still working on this with the script debugger.  I created a user level script called "commit records" and found that it over road the built in "commit records" which was useful as by tagging it with spoken feedback it was then easy to see where records were being committed.  When I deleted this temporary script it appears to have removed the original "commit records".  Any Idea how to get it back.  I did not imagine that deleting a user level script would result in the loss of basic FM functions.   

                         Thank you

                    • 7. Re: FM13: Layout objects are not refreshed as expected when using Conditional formatting
                      philmodjunk

                           It does not. you can commit a record simply by clicking a blank area of your layout.

                           I can't really tell from your post what you mean by: "it appears to have removed the original "commit records"."

                      • 8. Re: FM13: Layout objects are not refreshed as expected when using Conditional formatting
                        ScottBleackley

                             an alert box appears that says "This script cannot be found or has been deleted."  
                             I currently have no calls in my scripts to "commit record"
                             This appears to be happening when the system uses commit record.
                              

                        • 9. Re: FM13: Layout objects are not refreshed as expected when using Conditional formatting
                          philmodjunk

                               Open Layout Setup. Check the OnRecordCommit trigger. You've deleted the script, but not the trigger. The trigger tries to perform the script and shows that error as it can no longer find that script to perform. Clear that check box and this error message will go away.