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

Good that you found it. I did mention the condition 🙂

"Your code looks oke. Is the condition actually triggered at all? Did you debug that?"

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

How did the alert come then I wonder, I wanted to check the same, condition.

 

-Anurag

find_real_file.png

function onCondition() {
g_form.clearValue('select_an_end_date');
g_form.showFieldMsg('select_an_end_date', 'Please select future date', 'error', true);
}

 

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

They way you have done is fine.

-Anurag