- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 08:12 AM
I am getting follwong error after Helsinki upgrade on one fo my custom app.
Illegal access to private script include DurationCalculator in scope rhino.global being called from scope
Any thoughts ?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 08:37 AM
Change the the script include so that it is accessible form all application scopes as shown below.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 08:16 AM
use new global.DurationCalculator()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 08:26 AM
function onBefore(current, previous) {
//This function will be automatically called when this rule is processed.
gs.include('DurationCalculator');
var time_elapsed = executeSample(current.opened_at,current.closed_at);
var workday = 32400;
var time_elapsed_1 = time_elapsed/workday;
time_elapsed = time_elapsed_1.toFixed(1);
current.turn_around = time_elapsed;
}
function executeSample(sDate,eDate) {
// First we need a DurationCalculator object.
var dc = new global.DurationCalculator();
// The above sample is useful in limited cases. We almost always want to
// use some schedule in a duration computation, let's load a schedule.
addSchedule(dc);
// Compute a duration using the schedule. The schedule
// specifies a nine hour work day. The output of this is 32400 seconds, or
// a nine hour span.
dur = dc.calcScheduleDuration(sDate,eDate);
gs.info("calcScheduleDuration with schedule with Dynamic Values: " + dur);
return dur;
}
function addSchedule(durationCalculator) {
// Load the "8-5 weekdays excluding holidays" schedule into our duration calculator.
var scheduleName = "8-5 weekdays";
var grSched = new GlideRecord('cmn_schedule');
grSched.addQuery('name', scheduleName);
grSched.query();
if (!grSched.next()) {
gs.log('*** Could not find schedule "' + scheduleName + '"');
return;
}
durationCalculator.setSchedule(grSched.getUniqueValue());
}
Can you tell me where exactly ? I am already using new global.DurationCalculator(); at line 12

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 08:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 08:55 AM
Thank You that worked