- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2016 10:57 AM
How to set a value for glide duration fields , below is code i am using
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);// value i am getting back here is '324000'
current.business_duration = time_elapsed; // this line is not working
current.calendar_duration = time_elapsed; // this line is not working
time_elapsed = time_elapsed.toFixed(1);
current.description=time_elapsed;
}
any thoughts ?
Thanks in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2016 10:59 AM
Hi,
Please check section 4 for more info.
http://wiki.servicenow.com/index.php?title=Setting_the_Duration_Field_Value#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2016 12:20 PM
I am not able to message you, here are details https://dev15745.service-now.com User:pradeepk , application name:Nish App Table Business Rule:Run Schedule Thanks again
Edit: i see you already logged in. so i removed password from here.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2016 12:47 PM
Hi,
Can you please check the code. I hardcoded the value for testing purpose and it works.
There should be a issue with the value return from the function executeSample. Can you please check for the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2016 01:31 PM
Thanks now i understood how it works.