- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 08:09 AM - edited 08-12-2024 08:09 AM
Hello, I want to create an error message for a question. The question (date) variable is: what_is_the_expected_date_that_the_refresh_must_be_completed_by
The error message should say "Load release across partitions can only be completed on weekends." when users select thursday as a date AND say yes to variable load_release_across_partition.
This is a known problem with SN PRB1694977 as for some reason Thursdays don't work in the UI builder. Support told me ill need to script this one out. I am not too familiar with scripting, is someone able to help me with this?
If more background is needed please see my other post: Re: Can someone explain why trend by Thursday does... - Page 2 - ServiceNow Community
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2024 09:34 AM
Hi @Andrew Meza ,
Sharing the update set xml to you.
Catalog name is Weekday Catalog item.
After importing just hit the url,
/esc?id=sc_cat_item&sys_id=207ba938c3cc521017aeb61ed40131ee
I believe this will help you.
Regards,
Najmuddin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2024 01:06 PM
var cdt = new GlideDateTime();
for (i = 0; i< 7; i++) {
gs.print('Date = ' + cdt + ', dayOfWeek (local) = ' + cdt.getDayOfWeekLocalTime() + ', dayOfWeek (UTC) = ' + cdt.getDayOfWeekUTC());
cdt.addDays(1);
}results in:
*** Script: Date = 2024-08-13 20:04:19, dayOfWeek (local) = 2, dayOfWeek (UTC) = 2
*** Script: Date = 2024-08-14 20:04:19, dayOfWeek (local) = 3, dayOfWeek (UTC) = 3
*** Script: Date = 2024-08-15 20:04:19, dayOfWeek (local) = 4, dayOfWeek (UTC) = 4
*** Script: Date = 2024-08-16 20:04:19, dayOfWeek (local) = 5, dayOfWeek (UTC) = 5
*** Script: Date = 2024-08-17 20:04:19, dayOfWeek (local) = 6, dayOfWeek (UTC) = 6
*** Script: Date = 2024-08-18 20:04:19, dayOfWeek (local) = 7, dayOfWeek (UTC) = 7
*** Script: Date = 2024-08-19 20:04:19, dayOfWeek (local) = 1, dayOfWeek (UTC) = 1when run in Scripts - Background. Results should vary during the day based on the instance/user's time zone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2024 01:15 PM
Hi @Bert_c1 ,
So, even though with different time zone getDayOfWeekLocalTime returns the same days of the week for every user ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2024 04:17 PM
