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 
    575 Views, 9 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

    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

      Hi Jeff_D

       

      which version of FileMaker ?

    • Jeff_D
      Filemaker 10 pro
    • Jade

      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

      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

      Daniele,

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

      ????

    • raybaudi

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

       

      Try another time or give me your email.

    • Jeff_D

      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

      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. 

    • Polly Ryan

      Hi Jeff,

      I am trying to accomplish this task. I am not an experienced programmer and only have intermediate skills at using FileMaker.

      Do you mind elaborating further about how to use this script? For instance the steps taken to assign this script to a button, what you do in the flag portion of the script and how and where do you assign the color in the script?

      Basically I need step by step instructions...assume I know nothing.

      Thanks,

      Polly