- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 12:04 PM
Can you please share a screenshot of script include. Can you please confirm if script include "Accessible from" is set to all application scope?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 12:17 PM
Of course ...
The "Accessible From" field WAS incorrectly set. I've changed it to "all application scopes" (as showing above). PROGRESS!
Now I'm getting the second prompt from my original post ( alert('into doSomething'); ) but the last alert that returns an answer is still coming back as "null".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 12:20 PM
Thanks for the update Sue. Replace script include with below updated code.
var ClientDateTimeUtils = Class.create();
ClientDateTimeUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
addDateAmount: function(){
var firstDT = this.getParameter('sysparm_fdt'); //First Date Field
var addTYPE = this.getParameter('sysparm_addtype'); //What to add - day (addDays()), week (addWeeks()), month (addMonths()), year (addYears())
var addTIME = this.getParameter('sysparm_addtime'); //How much time to add
var day = GlideDate();
day.setValue(firstDT);
if(addTYPE == 'day'){day.addDays(addTIME);}
else if (addTYPE == 'week'){day.addWeeks(addTIME);}
else if (addTYPE == 'month'){day.addMonths(addTIME);}
else if (addTYPE == 'year'){day.addYears(addTIME);}
else {day.addDays(addTIME);}
//return "First Date: " + firstDT + " -Time to Add: " + addTIME + " -Add Type: " + addTYPE + " -Added Time: " + day;
return day;
},
_privateFunction: function() { // this function is not client callable
}
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 12:24 PM
I'll give that a try too, but first I did find an error in my client script.
var cdt = g_form.getValue(newValue); //Choose the field to add time from
should be
var cdt = newValue; //Choose the field to add time from
Now I'm actually passing in the correct parameter, but I'm still getting a null result to let me try your next suggestion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 12:30 PM
EUREKA!!!
That worked.
It looks like the only difference is the addition of this line outside the 'addDateAmount' function:
_privateFunction: function() { // this function is not client callable
What does this line do?
If I add further functions into this script include should this line be at the very end of the script include or is it repeated with each function?
Thank you SO MUCH for your help.