g_form.showFieldMsg not working in catalog ui policy script

chaithra
Tera Contributor

g_form.showFieldMsg not working in catalog ui policy

find_real_file.png

 

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Chaithra,

 

Can you use below

g_form.setValue('select_an_end_date','');

g_form.showFieldMsg('select_an_end_date','Please select future date','error',true);

View solution in original post

16 REPLIES 16

Did reproduce here and it's working 😞

Did you try .setValue('select_an_end_date', '') like I mentioned?

Can you also try:

g_form.showErrorBox('select_an_end_date', "Your message");

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

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

only alert is working , I tried showFieldMsg, showErrorBox,infoMessage ,but not working

Can you confirm you are using the correct variable name (select_an_end_date)?

If that is wrong then it wouldn't know where to show the error message.

-Anurag

Any other Client Scripts / UI Policies which might get triggered because of your clearValue? And causing a clearMessages perhaps? Can you check?

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

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

Sorry , i did not gave the condition in when to apply section. Now its working fine 

Which one is best practices for the date validation using Ui policy or client script?

Thank you guys sooo much! This solved the issue!!!