Multiple error message in form

Mr_Blue
Tera Expert

Hello All, I am getting multiple error message on the screen on every user date invlaid click ...

Can someone please help me to remove the multiple error message .... thank you in advance 🙂

Error :

find_real_file.png

UI Policy :

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Is the issue that you are getting multiple messages? Or are the messages incorrectly in your opinion?

If multiple messages, try clearing first:

g_form.clearMessages();
g_form.addErrorMessage("your error message");

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

4 REPLIES 4

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Is the issue that you are getting multiple messages? Or are the messages incorrectly in your opinion?

If multiple messages, try clearing first:

g_form.clearMessages();
g_form.addErrorMessage("your error message");

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Eric Dohr
Giga Contributor

Hi Bright,

To confirm, your logic is accurate and your expected behavior is only one error notification where as you are seeing it three times?  Just making sure the question is specific to the number of pop ups versus the logic and code.

Harsh Vardhan
Giga Patron

UI Policy seems like correct here. 

 

try to use "field watch" on the "DOB" field and see if any existing script has been used on DOB fields with same logic. 

 

https://docs.servicenow.com/bundle/london-application-development/page/script/debugging/concept/c_Fi...

Mr_Blue
Tera Expert

Hey Thank you EveryOne for helping me ...