I have four date fields.

taahamushtaq
Tera Contributor

I have four date fields on my catalog form. I have four fields in two pairs i.e. Week start date & Week end date as one pair, normal start date and normal end date as second pair.
Now I want to validate, atleast one pair of date is selected before submitting the form.

9 REPLIES 9

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Whats the issue you are running in to doing this with UI Policies?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

 I am trying to achieve it with Client script.

I am giving if-conditon and checking if any of the pair is not not empty but it is not working,

var weekDate = startDate1 && endDate1 == '';
    var startDate = startDate2 && endDate2 == '';
    if (weekDate == 'True' || startDate == 'True')

So why not with UI Policy? As what you are sharing does not need any scripting.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

What do you want to validate and when?

 

-Anurag