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.

Help with Catalog Client Script

Jen11
Tera Expert

I have a drop down menu called 'What is the nature of your request?' When the value for this question is either 4 or 5, I would like to show a field message under another field called 'New Approver'.

For value 4 it works fine, but when value 5 is selected the field message shows twice: 

Jen11_0-1706031935756.png

 

I have the following onChange Catalog client script: 

 

Jen11_1-1706032011754.png

 

Can someone please help me on what I am missing?

Thank you, 

 

 

1 ACCEPTED SOLUTION

SANDEEP28
Mega Sage

@Jen11 You can simply add below method above your if statement. It will clear previously set field messages

 

g_form.hideFieldMsg('u_new_approver');
 
I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

View solution in original post

3 REPLIES 3

SANDEEP28
Mega Sage

@Jen11 You can simply add below method above your if statement. It will clear previously set field messages

 

g_form.hideFieldMsg('u_new_approver');
 
I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

thank you. that worked. 

Sandeep Rajput
Tera Patron
Tera Patron

@Jen11 Use the following line before line number 8 in your script.

 

g_form.hideFieldMsg('u_new_approver', true);