6 Replies Latest reply on Aug 13, 2015 2:39 PM by msingson

    How to change fill color of one field based on the condition of another field

    msingson

      I would like to have one field turn red if the value of another field is greater than 0.2 and would like to know in what format do the fields need to be.

       

      I have this code in the Text Field Properties>Custom calculation script field, but it's acting funny:

       

      var x = getField("fill_35").value

       

      if (x.value > 0.2)

       

      event.target.fillColor = color.red

       

      And the format of the active field is set to "None" and "fill_35" is set to "Number".

       

      By the way, "fill_35" is the difference between 2 other fields.

       

      I have this code in Text Field Properties>Custom calculation script field for "fill_35".

       

      var v1 = getField("Locked.25").value;

      var v2 = getField("Locked.49").value;

       

      if (v1 !== "" && v2 !== "")

       

      event.value = v1 - v2

       

      else

       

      event.value = "0.00"

       

      Please help. Thank you in advance!