This is a public Forum  publicRSS

Forum post

    Jeff_D
    Script to Highlight(Color) a FieldAnswered
    Forum post posted February 17, 2009 by Jeff_D, last edited February 9, 2012
    486 Views, 8 Comments
    Title:
    Script to Highlight(Color) a Field
    Post:
    How do you write a script(Button) to highlight or shade a field? No based on any criteria. Simply hit a button once to color the field then hit it again to return it to normal.

    Best Answer

    raybaudi
    posted February 17, 2009 by raybaudi  Permalink

    1) Create a button with this script step:

     

    Set Field [ yourField ; Let( $flag = Abs ( $flag - 1 ) ; YourField ) ]

     

    2) Conditional format yourField with this:

     

    Formula is $flag

     

    and choose the fill color.

    Answer

     

    • raybaudi
      posted February 17, 2009 by raybaudi  Permalink

      Hi Jeff_D

       

      which version of FileMaker ?

    • Jeff_D
      posted February 17, 2009 by Jeff_D  Permalink
      Filemaker 10 pro
    • Jade
      posted February 17, 2009 by Jade  Permalink

      Just an idea…

       

      1. Set a global variable ($$toggle) to 0 (off) in your start-up script.

      2. Set $$toggle to not $$toggle in your button script. This will set it to 1 or 0 (on or off)

      3. For the field in question, use the conditional formula to If($$toggle)…set the background and text color you want.

       

      Hope this helps. 

    • raybaudi
      posted February 17, 2009 by raybaudi  Permalink

      1) Create a button with this script step:

       

      Set Field [ yourField ; Let( $flag = Abs ( $flag - 1 ) ; YourField ) ]

       

      2) Conditional format yourField with this:

       

      Formula is $flag

       

      and choose the fill color.

    • Jeff_D
      posted February 17, 2009 by Jeff_D  Permalink

      Daniele,

      I tried your version, just like you have it written, and it isn't working.

      ????

    • raybaudi
      posted February 17, 2009 by raybaudi  Permalink

      This is really simple and I can't make it not working.

       

      Try another time or give me your email.

    • Jeff_D
      posted February 18, 2009 by Jeff_D  Permalink

      Daniele,

      You're good & I'm not.

       

      <email blanked out by TSGal due to privacy - private message sent to raybaudi with email address> 

       

      Thanks.

    • TSGal
      posted February 18, 2009 by TSGal  Permalink

      Jeff_D and raybaudi:

       

      I have sent you both a private message.  To access the private message, go to the top of this page, look on the right side just under the blue bar where it says "X Messages".  Click here to read the message.

       

      Thank you.

       

      TSGal

      FileMaker, Inc.