6 Replies Latest reply on Sep 10, 2014 2:13 AM by paolobkk

    How do I highlight the selected record row in list view?

    AM_1

      Title

      How do I highlight the selected record row in list view?

      Post

      There seem to be many old discussions about this on the Internet but I haven't yet found a simple way to do this. I want to have the selected row stand out visually, augmenting the tiny black bar on the far left of the row. I've tried conditional formatting but there is no option within this to format a field depending on whether the record is selected or not, only on whether the data WITHIN the field meets certain criteria.

       

      Has anyone got a simple and elegant solution

        • 1. Re: How do I highlight the selected record row in list view?
          philmodjunk

          Use a conditional format expressiong to check the value of a variable. Use a script trigger to perform a script to update the variable.

          Use OnRecordLoad to perform this script:

          Set Variable [$$RecordID ; value: Get ( RecordID ) ]

          Use this conditional format expression:

          $$RecordID = Get ( RecordID )

          • 2. Re: How do I highlight the selected record row in list view?
            AM_1

            I'm not a programmer and am new to databases and FMP, so I haven't really understood your suggestion.

            Say I have a table with two fields "Name" and "DoB" and I create a layout showing these fields in list view.

            Do I a) go to layout setup and tick the "onRecordLoad" for that layout?

            b) then create a script -  Set Variable [$$RecordID ; value: Get ( RecordID ) ] - WHAT IS THE RecordID?

            c) then where does the conditional format expression go?

             

             

             

             

            Could you explain the principle behind this 

            • 3. Re: How do I highlight the selected record row in list view?
              philmodjunk

              With any post in this forum, if there are terms that you don't recognize, looking them up in FileMaker help often helps explain what you saw in the forum post.

              a) Yes

              b) Yes, when you click specify after selecting OnRecordLoad you get a dialog where you can click the + button to start adding a new script. You may find that you need a second step: Refresh Window after the set variable step. If you don't see the field's fill color changing like it should, try adding that step. (You can use Manage | Scripts to edit, create and delete scripts in your file.) RecordID is an internally generated ID number that uniquely identifies each record in your table. The script step uses the Get funciton (You can look this function up to learn more) to copy the current record's RecordID into the variable. Using $$ as the beginning of the variable's name makes it a global variable whose value will be accessible from thorughout your file and the value will remain in this variable until you close the file.

              c) Enter layout mode and select your two fields by shift clicking them. Then right click one of them (or control click if you have Mac, one button mouse) and select Conditional Format. Conditional Format is another term that you can look up in FileMaker help to learn more.

              • 4. Re: How do I highlight the selected record row in list view?
                JohnEriksson

                     Thanks, used this method, worked great.

                     The update window step was needed.

                • 5. Re: How do I highlight the selected record row in list view?
                  nass3380

                       I applied these steps for the first list and it worked

                       but on a second list (for a different table) i's not working

                       why?

                  • 6. Re: How do I highlight the selected record row in list view?
                    paolobkk

                    I found this post as I was looking for the same result.

                    The script performed "OnRecordLoad" as described:

                    $$RecordID = Get ( RecordID )

                    it works great but only if all records in the layout are from the same table.

                    Related records are not being highlighted very smoothly. 

                    For related records I had to add "Refresh Window" script step to fix it.

                    Cheers!