- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2020 10:39 PM
Hey Lakshman,
Check out this below similar thread it will help you,
kindly mark Correct and Helpful if Applicable.
Regards,
Indrajit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2020 05:18 AM
Apologies, my bad can you replace
- start_date with sysparm_start_date
- months_to_add with sysparm_months_to_add
in both the client script and script include. That should work fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2020 05:43 AM
Naveen,
Still the same issue -- getting Null from script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2020 06:02 AM
can you share the code because it is working fine for me with following code
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var ga = new GlideAjax('ScriptIncludeName');
ga.addParam('sysparm_name', 'addMonths');
ga.addParam('start_date', g_form.getValue('start_date'));
ga.addParam('months_to_add', 6);
ga.getXML(getEndDate);
}
function getEndDate(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
if (answer) {
if (g_form.getValue('end_date') > answer) {
alert("End date should be less than " + answer);
}
}
}
var ScriptIncludeName = Class.create();
ScriptIncludeName.prototype = Object.extendsObject(AbstractAjaxProcessor, {
addMonths: function() {
var start_date = this.getParameter('start_date');
var months = this.getParameter('months_to_add');
var gdt = new GlideDateTime(start_date);
gdt.addMonths(months);
return gdt.getDate();
},
type: 'ScriptIncludeName'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2020 08:00 PM
Hey Lakshman,
Check out this threads, it will help you:
Mark Correct and Helpful if it helps!!!
Best Regards,
Namrata.