- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 01:30 PM
We have a script attached to a form field which is
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var cdt = g_form.getValue("u_target_start_date");
var ajax = new GlideAjax('sn_hr_core.ClientDateTimeUtils');
ajax.addParam('sysparm_name', 'validateDate');
ajax.addParam('sysparm_date', cdt);
ajax.getXML(getDate);
function getDate(response) {
var answer = response.responseXML.documentElement.getAttribute('answer');
//console.log(answer);
if (answer == "false") {
alert("Please select a Monday that is at least 2 weeks from the date of your request");
g_form.clearValue("u_target_start_date");
g_form.clearValue("u_year_1_effective_date");
g_form.clearValue("u_year_1_effective_date_end");
g_form.clearValue("u_year_2_effective_date");
g_form.clearValue("u_year_2_effective_date_end");
g_form.clearValue("u_year_3_effective_date");
g_form.clearValue("u_year_3_effective_date_end");
return false;
}
}
}
thiss was done by a third party and I am trying to figure out how to modify the underlying validation that takes place as we need to change it from 2 weeks to 3 weeks.
Where in the world do you go to change something like this? Anything I can think of leads me no where.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2024 02:35 AM
@bigbacon The main logic for this validation lies within the Script include
ClientDateTimeUtils
You will be able to find this script include inside Human Resource: Core application scope.
Once you are inside the script include, you need to search for a function with name
validateDate
Inside this function you will find the validation for two weeks.
Please mark the response helpful and accepted solution if it manages to answer your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2024 02:35 AM
@bigbacon The main logic for this validation lies within the Script include
ClientDateTimeUtils
You will be able to find this script include inside Human Resource: Core application scope.
Once you are inside the script include, you need to search for a function with name
validateDate
Inside this function you will find the validation for two weeks.
Please mark the response helpful and accepted solution if it manages to answer your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2024 06:25 AM
I exported all these and searched the script for that and came up with nothing that does a validation based on a 2 week range from today's date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2024 06:56 AM
Ok, update, that worked. I totally missed it all at first.
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 04:11 AM
@bigbacon Glad to know it worked.