Variable defined as an array of fields
Hi All!
I am sort of a novice at Java and am needing to format field a number of fields based on a dropdown. I have been searching for days on a resolution but hacnet found what I need. I have this so far, but I am needing to only change the fill certain fields based on the dropdown option of yes or no. What I am wanting is If "Yes", only fields N1, SS1, D1, & In1 are highlighted and if "No", all fields are highlighted.
var newfillColor;
if (event.value=="Yes") newfillColor = color.yellow;
else if (event.value=="No") newfillColor = color.yellow;
else newfillColor = color.transparent;
event.target.newfillColor = newfillColor;
this.getField("N1").fillColor = newfillColor;
this.getField("SS1").fillColor = newfillColor;
this.getField("D1").fillColor = newfillColor;
this.getField("Pa1").fillColor = newfillColor;
this.getField("Ph1").fillColor = newfillColor;
this.getField("Em1").fillColor = newfillColor;
this.getField("C1").fillColor = newfillColor;
this.getField("Emp1").fillColor = newfillColor;
this.getField("EPla1").fillColor = newfillColor;
this.getField("In1").fillColor = newfillColor;
Would the below work?
var newfillColor;
if (event.value=="Yes") {
this.getField("N1").fillColor = newfillColor;
this.getField("SS1").fillColor = newfillColor;
this.getField("D1").fillColor = newfillColor
};
else if (event.value=="No") {
var newfillColor = color.yellow;
this.getField("N1").fillColor = newfillColor;
this.getField("SS1").fillColor = newfillColor;
this.getField("D1").fillColor = newfillColor;
this.getField("Pa1").fillColor = newfillColor;
this.getField("Ph1").fillColor = newfillColor;
this.getField("Em1").fillColor = newfillColor;
this.getField("C1").fillColor = newfillColor;
this.getField("Emp1").fillColor = newfillColor;
this.getField("EPla1").fillColor = newfillColor;
this.getField("In1").fillColor = newfillColor
};
else newfillColor = color.transparent;
event.target.newfillColor = newfillColor;
