2 Replies Latest reply on Mar 26, 2009 7:59 PM by dinora

    Higlighting a portal record



      Higlighting a portal record


      Can you make a portal record higlighted or bold when one clicks on it?  Sort of making sure the user knows which record he or she is at?




        • 1. Re: Higlighting a portal record
             Yes, I'll have to look this up, unless someone posts sooner, but I recall a way of doing this involves using global values, and I think they insert color into the global field ( like go to layout mode, copy the color you like, then go back to browse mode, and paste this copied color into the global field -- kind of trick on this aspect, from what I recall ) ... then I think maybe conditional formating introduced another way to this as well. Now I'm wondering if a Script Trigger will allow yet another way. If thats all true, then the question would be, which has the most advantages?
          • 2. Re: Higlighting a portal record

            Yes you are correct


            I found the following explanation in David's Head website at Ulearnit -  Is this what you are referring to? I have not tried it yet -  But I believe it will work


            FileMaker Pro provides a very understated black mark at the left of the current record when in list view. To make the current record more obvious, we can highlight the background with a colour.

            FileMaker Pro current record indicator

            We can script the process of identifying the current record ID in a global field. In the sample file, we created a global number field called current record ID in the Data table. In fact, it can be created in any table of your file and used across all tables.

            We created a text object on the layout by simply typing a space character. Then the text object was resized to that required to completely cover the body part in the layout. So that we can see it, we set the fill to a light grey colour.

            Conditional formatting was applied to the text object. We set two conditions. The formulae used are:


               Data::current record ID = Get ( RecordID )

            The first expression (simply the number 1) is always true. It sets the fill colour to white. So why do you see it as grey in Layout mode? Because conditional formatting is not evaluated in Layout mode.

            Stop! You may want to re-read that last sentence - it is very useful information. ;)

            The second expression is true when the value in the global field matches the RecordID of the record. The fill colour for this overrides the first condition when the expression is true.

            The script we used is very simple. It is called Record highlighter and has a single step:

            Set Field [Data::current record ID; Get ( RecordID )

            This places the RecordID of the current record into the global field.

            Finally, we set the layout script trigger, OnRecordLoad, to run the script.

            So the effect is that when a record loads* in the list, its recordID is set as the value of the global field. Since the second conditional formatting formula evaluates to true, the text object in the background of that record changes colour and highlights the record.

            Improved current record highlighting

            * A record loads when the user clicks on the record, navigates to it with the book in the status toolbar, uses the Go to Record command or uses a scripted process to switch records. Records also load when a new window is opened, a record is created or deleted, or when a Find result is returned.