Need help in Record producer Availability configuration in servicenow

SaiMounikaY
Tera Contributor

A record producer is configured and only the users in AVailable for are able to see but at some period of time every week the users should not be able to submit the record producer form. The Time they should not see thrus day 11:00 Pm to Friday 12:00 PM. How can we achieve this

 

2 REPLIES 2

GlideFather
Tera Patron

Hi @SaiMounikaY,

 

during this one hour (11-12 PM) the record producer shall not be available to anyone or just to selected audience?

 

What is the business justification of this? I don't see any benefit in that. Is it really important whether a record producer was submitted 10:59 or 12:01? There might be SLAs but rather update the shifts/schedules accordingly, no?

 

Some people might even submit it on weekend but it will not be any difference from submitting it on monday early morning..

 

Is it really worth the efforts because of one hour?

_____
100 % GlideFather experience and 0 % generative AI

Ankur Bawiskar
Tera Patron

@SaiMounikaY 

you can use advanced script in user criteria and check the time

something like this but please enhance

var gdt = new GlideDateTime();
var localTimeStr = gdt.getLocalDate();  // "2026-04-10 15:47:00" format (local time)
var parts = localTimeStr.split(' ');
var timeParts = parts[1].split(':');    // ["15", "47", "00"]
var hour = parseInt(timeParts[0], 10);  // 15
var minute = parseInt(timeParts[1], 10); // 47
var day = parseInt(gdt.getDayOfWeekLocalTime(), 10); // 1=Mon, 4=Thu, 5=Fri

var isBlocked = false;

// Thursday (4) 11:00 PM (23:00) to Friday (5) 12:00 PM (12:00)
if (day == 4 && hour >= 23) {
    isBlocked = true;
} else if (day == 5 && hour < 12) {
    isBlocked = true;
}

answer = !isBlocked;  // true = allow access, false = block

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader