Displaying a catalog item on specific dates

samadam
Kilo Sage

I have a requirement to show the catalog item to users only in certain time period (march - April) and if its a new employee show it for them after 60 days. Is there any way to accomplish this?

3 REPLIES 3

Harish KM
Kilo Patron
Kilo Patron

Hi for this I think you need to glide script in User criteria advanced condition and return true if it matches march - april and another User criteria to check employee start date by gliding user table.

The below links will give you a start

https://community.servicenow.com/community?id=community_question&sys_id=23b79a42dbb9a050da1999ead3961981

https://community.servicenow.com/community?id=community_question&sys_id=a8718b29db98dbc01dcaf3231f961986

Regards
Harish

samadam
Kilo Sage

Thank you, I tried to create a user criteria with the following but doesnt work

var gd =new GlideDate();
var month = gd.getMonthNoTZ();
gs.info(month);
if (month == 4){
    answer = true;
}

 

 

Did you try using GlideDateTime as well?

var answer = false;
var gdt = new GlideDateTime(); 
var month = gdt.getMonthUTC());
if (month === 3 || month === 4) answer = true;