4 Replies Latest reply on Mar 6, 2013 5:34 AM by dburnham

    Flaky Conditional Formatting

    deanchampeau

      I'm trying to use conditional formatting to do a very simple thing... format text conditionally to create a menu for users that signifies what layout they happen to be on. But I'm experiencing all kinds of flakiness that doesn't make any sense.

       

      Basically, I've created 4 little pieces of text that act as menu items displayed along the top of my layouts. I have them defined as buttons that take the user to the desired layout. I also have conditional formatting applied to each of the pieces of text using a formula... get (layoutname) = "customer" (as an example). Each piece of text has it's corresponding layout name in the conditonal-formatting formula. As far as the formatting itself, all I'm doing is applying a simple underline.

       

      But when I browse, it will work for a while, but then if I move type around, or change the typeface or whatever, it will stop working. Actually, it will stop working for some of the items to which I've applied conditional formatting, but continue to work for others. Truly strange behavior.

       

      Has anyone else encountered this?

       

      Dean

        • 1. Re: Flaky Conditional Formatting
          eshoshin

          Haven't had flaky conditional formatting before.  Possibly something with how you wrote the calculation or maybe you haven't applied the conditional formatting to all of the text strings on each layout?

           

          Question: Wouldn't it be easier to just hard-code the underline for each layout?  For example, lets say I have Customers, Invoices, Events and To-Do as my layouts.  When on the Customers layout, I could have "Customers" text be underlined... no conditional formatting, just simple text attribute.  On Invoices layout, "Invoices" is the only one underlined and so on.  Does that make sense?

          • 2. Re: Flaky Conditional Formatting
            deanchampeau

            Yes it does make sense, and I've used that technique in the past, but I thought I'd give conditional formatting a try for this, because it would make maintaining the menus easier... If I'm making some kind of change to the menus (typestyle, position, anything), I can make the change just once on a single layout and then copy/paste to other layouts, and I wouldn't have to redo the hard-coding of layout-specific formatting.

            • 3. Re: Flaky Conditional Formatting
              Mike_Mitchell

              Conditional Formatting has some interesting dependency rules that may be responsible for what you're seeing. Darren Terry covered this at last year's DevCon. Conditional Formatting applies on data change, not data commit (including related data change and changes made in other windows, unlike unstored calculations).

               

              However, in your case, you're using Get ( CurrentLayout ), which is itself an unstored calculation. Hence, you have a dependency on an unstored calculation, which may or may not update when you think it should.

               

              An unstored calculation will refresh only when there's a change in local referenced data, or if the calculation is redrawn on screen. Given that, I suggest you embed a Refresh Window Script Trigger into the solution to force a window refresh. This will force the Get ( CurrentLayout ) to update, which will trigger the Conditional Formatting to update consistently.

               

              HTH

               

              Mike

              • 4. Re: Flaky Conditional Formatting
                dburnham

                Try using the Refresh Window script step to see if that makes the problem disappear, especially if your conditional formats rely on any joined data.