- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 05:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2016 06:52 AM
Soni,
Add alert in your call back function as shown below and let me know what you see.
Here is your onChange client script on Needed By variable:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
g_form.setDisplay('title', false); // put in the variable name you want to show or hide according needed by date
return;
}
var ga = new GlideAjax('ValidateNeededBy');
ga.addParam('sysparm_name','validateDate');
ga.addParam('sysparm_needed_by',newValue);
ga.getXML(callBack);
function callBack(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
if(parseInt(answer)>=27){
g_form.setDisplay('title', false); // put in the variable name you want to show or hide according needed by date
}
else{
g_form.setDisplay('title', true); // put in the variable name you want to show or hide according needed by date
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2016 06:52 AM
Soni,
Add alert in your call back function as shown below and let me know what you see.
Here is your onChange client script on Needed By variable:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
g_form.setDisplay('title', false); // put in the variable name you want to show or hide according needed by date
return;
}
var ga = new GlideAjax('ValidateNeededBy');
ga.addParam('sysparm_name','validateDate');
ga.addParam('sysparm_needed_by',newValue);
ga.getXML(callBack);
function callBack(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
if(parseInt(answer)>=27){
g_form.setDisplay('title', false); // put in the variable name you want to show or hide according needed by date
}
else{
g_form.setDisplay('title', true); // put in the variable name you want to show or hide according needed by date
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2016 06:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2016 07:00 AM
if I select today 6/1/2016 it shows 0
if I select 6/2/2016 it shows 9
if I select 6/3/2016 it shows 18
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2016 07:02 AM
and if I use 24 hour day, M-F, excluding weekends and holidays schedule , it shows , 0 , 24 , 48 ,...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2016 07:03 AM
Soni,
Yes it is working as expected. So what do you want now? If the user selects 6/42016 it should hide the field and if the user selects 6/4/2016, it should show you a filed right?
Thanks,
Abhinay