Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Highlighting a field when a condition is met

Avatar

Level 2

Hello,

I am creating a form that has a field that aggregates amounts from a table.  What I want to do is make it so the total aggregate will become highlighted once it reaches a certain dollar amount or higher (example: if the total dollar amount of the purchases reaches $300.00 or more, then it will become highlighted).

I need this so people can easily look at this form and if the amount is highlighted, they will know they have to fill out another form for this amount.

I hope that makes sense...

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

I'm guessing you are already using a calculate event, so you should be able to highlight the field in that script, something like;

var result = NumericField1.rawValue + NumericField2.rawValue;

if (result > 300)

{

    this.fillColor = "255,0,0";

}

result;

Just remember that the result of the calculate script is the last value evaluated.

Regards

Bruce

View solution in original post

0 Replies

Avatar

Correct answer by
Level 10

Hi,

I'm guessing you are already using a calculate event, so you should be able to highlight the field in that script, something like;

var result = NumericField1.rawValue + NumericField2.rawValue;

if (result > 300)

{

    this.fillColor = "255,0,0";

}

result;

Just remember that the result of the calculate script is the last value evaluated.

Regards

Bruce

Avatar

Level 2

That looks like what I want, but when I put your script into the field, it comes up with a syntax error

EDIT: Nevermind the error, figured that out.  Sadly this is what I need, but since it needs to be a Dynamic Form, I guess I can't use it.