Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Error message when greater than 25

BenjaminY
Tera Contributor

Hello,

 

I am task to create a UI policy on a form when the field "enter_time_spent_in_hours" is filled the integer must be greater than 25.

BenjaminY_0-1720533112777.png

 

 

 

6 REPLIES 6

Hi @BenjaminY ,

 

What is the exact issue you are facing.

 

From the image's description I understood, if the Time spent is less than 25, you should show an error messgae.

In Script Section:
Run if true:

g_form.showFieldMsg('<field_name>', '<Time Spent should be greater than 25>', 'error');

Run if false:

g_form.hideFieldMsg('<field_name>', true);

Mark the response correct and helpful if the answer assisted your question.

@BenjaminY Simply add following line in the script field of the UI Policy.

 

g_form.showErrorBox('enter_time_spent_in_hours','Please enter value greater than 25',true);