Regarding date field validation

SNOW24
Tera Contributor

Client Script : onChange
Create a new date field 'NEXT REVIEW DATE' and write code. Condition is : restrict the date field as it may allow only next 10 days from today

 

1 ACCEPTED SOLUTION

Ah oke.

Out-of-the-box, its the combination of Category and Subcategory. Especially Subcategory is important to look at.

 

When opening the dictionary for Subcategory:

 

1.

MarkRoethof_0-1690178849670.png

 

2.

MarkRoethof_1-1690178900749.png

 

That's all! Zero scripting or GlideAggregate.

 

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

8 REPLIES 8

Ah oke.

Out-of-the-box, its the combination of Category and Subcategory. Especially Subcategory is important to look at.

 

When opening the dictionary for Subcategory:

 

1.

MarkRoethof_0-1690178849670.png

 

2.

MarkRoethof_1-1690178900749.png

 

That's all! Zero scripting or GlideAggregate.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

Rahul Talreja
Mega Sage
Mega Sage

Hi @SNOW24 ,
Are you looking for incidents open for each subcataory?
Try this:

var agg = new GlideAggregate('incident');
agg.addAggregate('COUNT', 'category');
agg.orderBy('category');
agg.orderBy('subcategory');
agg.query();
while (agg.next()) {
    //do things on the results
    var incidentCount = agg.getAggregate('COUNT', 'category');
    var category = agg.getDisplayValue('category');
    var subcategory = agg.getDisplayValue('subcategory');
    gs.info('Display the count {0} and category {1}  subcatagory {2}', [incidentCount, category,subcategory]);
}
Please mark my response correct/helpful as applicable!
Thanks and Regards,
Rahul

Mark Roethof
Tera Patron
Tera Patron

Why are you updating the topicname and description again? And now its even extremely different than your original question?!

 

Just post a new question instead. Now people are responding, helping, etc. and suddenly you are changing everything 😅
And it would be nice if you also acknowledge that people are helping you for FREE.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

ok thank you