How can I add duration field value to a date/time field value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2016 12:52 AM
Hi Guys,
How can I add a duration field value to a date/time field?
Last working day= resigned date(date/time field)+ notice period days (duration field value). I am writing an on-change request and passing values to a script include to calculate last working day.
Note: Last working day should be autopopulated and it should be in the date format.
e.g if resigned date is 1/10/2016
notice period days =30 days
last working day should be 30/10/2016
Thanks
shraddha
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2016 11:10 PM
Hi Prashant,
BR is running in Global application but not in the scoped application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2016 11:24 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2016 11:27 PM
I can see that Geofrey's answer should be working provided you change the field name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2016 11:32 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2016 11:54 PM
You would have gotten the answer much earlier had you have given the complete information.
This should work. Make sure you change the field names.
var dc = new DurationCalculator();
dc.setStartDateTime(current.u_date_time);
dc.calcDuration((current.u_duration.getGlideObject().getNumericValue())/1000);
gs.addInfoMessage(dc.getEndDateTime());