2 Replies Latest reply on Apr 7, 2011 10:35 AM by Frinholp

    Highlighting current record in list view



      Highlighting current record in list view


      I have used a solution that it seems to be the standard (if not the only solution?) to make the current record in list view more visible.

      This uses conditional formatting and a script triggered on record load which stores the current record ID in a global variable, then refreshes the screen.

      I have an issue with this.

      I have a script attached to a button which (1) switches to a different layout, (2) shows all records and (3) performs a find.

      At each stage highlighted above causes the OnRecordLoad trigger to execute its script therefore performing a Refresh Screen three times.

      This prevents me from freezing the screen whilst the script attached to the button executes, resulting in something very unsightly.

      To make things worse I am using Windows, so the screen re-draws every time the the screen is refreshed resulting in flickering - when will Filemaker fix this? (It seems this has been an issue since FM7 and requests by users seem to be ignored. It would not suprise me if the next major release will have the same problem)

      Can anyone think of a way that I can prevent the OnRecordLoad script trigger from executing its script temporarily so I can keep the window frozen until I have my found set? Or a different technique to highlighting the current record?

      Thanks in advance


        • 1. Re: Highlighting current record in list view

          Two ways are avaialable to keep layout based triggers from firing when other scripts change layouts and/or records:


          Use a global variable to disable the triggered scripts:

          If [not $$TriggerOff]

             //your current script steps go here

          End If

          Then you can use Set Variable to assign True to $$TriggerOff in any script where you need to disable the script triggers and then reset the variable to false at each exit point in the script to re-enable the triggers.


          Use a different layout for these scripts that don't have any triggers. You can creat simple blank layouts that refer to the same table occurrence as your current layouts. Your script can switch to this layout, do the finds and sorts that you want, then switch back to the trigger equipped layout as the final step.


          • 2. Re: Highlighting current record in list view

            Interesting. I am actually moving from a layout based on the same table that does not have triggers so I shall freeze screen and perform my finds etc in there, then switch to the list layout.

            I also like the variable technique. I am trying to think of a way I can use this in another problem I have.

            Thanks Phil