Build following functionality on change request record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 09:32 PM
Build following functionality on change request record
For normal change when start date is selected. Validate if the date is not from the past and force user to enter future date
For emergency change the start date can be past date.
Build this using client script on the planned start date field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 09:48 PM
you can have onChange on planned start date, enhance as per your requirement
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || !newValue) {
return;
}
var changeType = g_form.getValue('type').toString();
if (changeType == 'normal') {
var date = new Date();
var dateEntered = new Date(getDateFromFormat(newValue, g_user_date_time_format));
if (dateEntered < date) {
g_form.showFieldMsg('start_date', 'Start date must be in the future for Normal changes.', 'error');
g_form.clearValue('start_date');
}
} else if (changeType == 'emergency') {
// add your validation if any you want
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 12:30 AM
Need to do using GlideAjax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 01:34 AM
I already shared solution without GlideAjax and it should work fine
For using GlideAjax refer below
Date field should not take past date.
It can be achieved using UI policy as well
No Code date validations thru (Catalog) UI Policies
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader