Put a warning message on record producer

dfry123
Mega Expert

Is there a way to put a warning message on a record producer (Either when first going to the form or after submitting) that only shows up after a certain time?

I need to put a warning up that shows up only during the hours of 5 PM - 8 AM.

Thank You!

1 ACCEPTED SOLUTION

rob_pastore
ServiceNow Employee
ServiceNow Employee

oops, i think i screwed you up earlier.  



looking at the error it says that it doesn't recognize the function isInSchedule('string') - becasue that function requires a date object not a string.   i told you getNow would be an object and that's where i messed you up.



put this back in



var schedTime = new GlideDateTime(gs.nowDateTime());      


View solution in original post

28 REPLIES 28

rob_pastore
ServiceNow Employee
ServiceNow Employee

You should be able to write this in the script section of the record producer.



Use gs.addInfoMessage()


dfry123
Mega Expert

Yes, that works but I need it to only happen at certain times of the day.


rob_pastore
ServiceNow Employee
ServiceNow Employee

Yes, but you can use these functions to calculate that:


http://wiki.servicenow.com/index.php?title=GlideDateTime


Thanks for the reply! Could you give me an example of how the script should look?