How set a value glide duration fields?

nthumma
Giga Guru

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

1 ACCEPTED SOLUTION
7 REPLIES 7

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.


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.


Thanks now i understood how it works.