- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2016 10:36 AM
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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2016 01:29 PM
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());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2016 01:10 PM
let's remove some variables here.
Go to the schdule record itself and copy the sys_id.
place the sys_id itself into new GlideSchedule() and comment out the 2 lines above it (glideRecord query to get sysid)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2016 01:16 PM
Ne code is below: and same error is below that.
gs.include("FormInfoHeader");
var fi = new FormInfoHeader();
var sched = new GlideSchedule("38f9a4e0c0a801640010a471b72952ba");
var schedTime = gs.nowDateTime();
gs.log('Time 1: ' + schedTime);
if (sched.isInSchedule(schedTime )) {
gs.addInfoMessage("in hours ");
}
else {
gs.addInfoMessage("after hours");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2016 01:29 PM
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());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2016 01:42 PM
Yes! That works!!
Thanks for all your help!!