3 Replies Latest reply on Jan 11, 2012 2:55 PM by GianandreaGattinoni

    Conditional Format with Get ( ActiveFieldName) Fails

    philmodjunk

      Summary

      Conditional Format with Get ( ActiveFieldName) Fails

      Product

      FileMaker Pro

      Version

      FMP 11.03

      Operating system version

      Windows XP, SP3

      Description of the issue

      About 1 time out of 8, conditional format expression set to change button text to grey if the specified field does not have the focus, fails to change the text color.

      This is intended to give a set of buttons that use Insert Text to insert text at the current cursor position a "disabled" look if the cursor is not currently in the field these buttons are intended to modify.

      Steps to reproduce the problem

      Conditional Format Expression:
      Let ( [ F = GetFieldName ( Templates::TemplateText ) ; L = Length ( F ) ] ; Get ( ActiveFieldName )  ≠ Right ( F ; L - Position ( F ; ":" ; 1 ; 2 ) ) )

      Add OnObjectEnter, OnObjectExit triggers on the TemplateText field to perform this one line script:
      Refresh Window []

      Expected result

      Clicking in the filed changes the text from Grey to Black. Clicking another field or the layout background changes the text back to grey.

      Actual result

      On random intervals, the text color does not change when you exit the field. Have added a show custom dialog step to the script to confirm that the window refresh was triggered correctly. (Can't reproduce bug when script debugger is enabled.)

      Using the "Flush cached join results" option does not work any better.

      Configuration information

      A file demonstrating this issue may be downloaded from: http://www.4shared.com/file/Z36UjVOL/MessageTemplateBuilder.html

      Workaround

      None that I've figured out so far. Will test on Windows 7 platform and report back tomorrow...

        • 1. Re: Conditional Format with Get ( ActiveFieldName) Fails
          TSGal

          PhilModJunk:

          Thank you for your post, and I apologize for the late reply.

          I'm unable to download from the enclosed link, so I suspect the link has expired.

          Also keep in mind that Get ( ActiveFieldName ) returns text and does not include the table name.  You may want to consider:

          GetFieldName ( Evaluate ( Get ( ActiveFIeldTableName ) & “::” & Get ( ActiveFieldName ) ) )

          I know almost three months have passed since you posted, so let me know if this is still active.  if you have either found a resolution or a different workaround, please post here so others can benefit.

          TSGal
          FileMaker, Inc.

          • 2. Re: Conditional Format with Get ( ActiveFieldName) Fails
            philmodjunk

            The fact that Get ( ActiveFieldTableName ) does not return a table name is not an issue here since I use this expression to compare just the field names:

            Let ( [ F = GetFieldName ( Templates::TemplateText ) ; L = Length ( F ) ] ; Get ( ActiveFieldName )  ≠ Right ( F ; L - Position ( F ; ":" ; 1 ; 2 ) ) )

            Besides, if that were the issue, it would fail 100% of the time, not at seemingly random intervals.

            Download links to 4Shared don't expire, but I did have problems uploading an update to this file back then and that appears to have been the source of the trouble.

            Here's a valid download link: http://www.4shared.com/file/7DdcpW11/MessageTemplateBuilder.html

            • 3. Re: Conditional Format with Get ( ActiveFieldName) Fails
              GianandreaGattinoni

              Hi Phil

              I tested your file and 100% never reformat the text button.

              only if you change record, the format is evaluted again

              To be sure that the expression is value correctly, I have added a text field and created a script, inserting into the new field the result of your expression. everything is fine.

              FM 11.v03

              Windows 7

               

              Gianandrea