7 Replies Latest reply on Feb 5, 2014 3:03 PM by nass3380

    Highlight all fields in an active record in list view

    jsys

      Title

      Highlight all fields in an active record in list view

      Post

      Using FM10 on windows,

       

      How do I highlight all fields of the active record in List view so that the active record stands out among the list? My thoughts are some combination of Conditional Formatting, a Script Trigger, or some Custom Function.

       

      thanks

        • 1. Re: Highlight all fields in an active record in list view
          Heine_1
            

          Hi jsys!

           

          In order for this to work, you'll need to click the actual record in list view AND have a field with a unique id for each record ;-)

           

          Create a button in layout mode, and make it fit the height and width of your display area, then send it to 'back' (Arrange-> Send to back). Make the fill color white or transparent as default, I don't think it will make a difference. Then set up a formula in the Conditional Formatting dialog box that says something like this:

           

          $$ID = <path to the field with your record ID> (Please note that I'm using a global variable hence the double '$'. That's very important)

          Then set the fill color or text color to something you like.

          Close the Conditional dialog box

           

          Now create a script that has these steps:

           

          Freeze Window

          Set Variable [$$ID; value:<path to the field with your record ID>]

          Commit Records/Requests [No Dialog]

          Refresh Window

           

          Finally connect the script to your button that you created at first and you should be on your way.

           

          What happens is that the script you're triggering each time you click on the button will collect the ID of the current record in the list and store it in a global variable ($$ID). The CF for the button looks at the information in $$ID and if this info matches the ID stored in the current ID field, ( and it always will ) then it will change the fill color of the button.

           

          The reason why I use a global variable is that the global variable lives in memory for as long as FileMaker is launched, therefore you can store a lot of fun and useful stuff there. Local variables only live during the processing of a script, which means that they 'die' when the script has been executed.

           

          Hope this helps ;-)

           

          /Heine 

          • 2. Re: Highlight all fields in an active record in list view
            Captain
              

            Hi, I think this is a simpler method and works well for portals since they are subject to a relationship.

             

            In a list of clients with a portal using a relationship that shows all records. Conditionally format the field to a background colour change when Client2::ID = Client::ID

             

            The active record will be highlighted.

             

            • 3. Re: Highlight all fields in an active record in list view
              comment_1
                

              Heine wrote:

               In order for this to work, you'll need to click the actual record in list view ...


              In version 10 you can trigger a script on record load, so it's not necessary to have a button and click it - you can have the current record highlight even if you are navigating through the tool bar/menu/keyboard.

               

              Actually, you don't need the button even in previous versions (8 and higher) - but that's more complicated…


              • 4. Re: Highlight all fields in an active record in list view
                comment_1
                  

                Captain wrote:
                In a list of clients with a portal using a relationship that shows all records. Conditionally format the field to a background colour change when Client2::ID = Client::ID

                I don't see how this is supposed to work. Could you post a demo somewhere?

                • 5. Re: Highlight all fields in an active record in list view
                  Heine_1
                    

                  Yep, this works great. ScriptTriggers are a really neat feature. Didn't think of using it here, but it's a lot easier than the first suggestion I made.

                  Cheer, Comment!

                    

                  • 6. Re: Highlight all fields in an active record in list view
                    jsys
                       Thanks all for your comments and input. I'll let you know how it turns out.
                    • 7. Re: Highlight all fields in an active record in list view
                      nass3380

                           Heine, does it work on multiple layouts?

                           it's working on the first layout I applied your way to but not on the second...