I want to add 14 days to the updated time and need to be showed in calendar_duration field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 05:14 AM
I want to add 14 days to the updated time and need to be showed in (calendar_duration) duration field on the incident form in the form of days hours and minutes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 06:34 AM
when should this be done? before insert of the record? which field holds the Updated time?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 10:59 PM
This should be done for after insert of record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 11:01 PM
you can use before insert BR then on that table
you can use GlideDateTime API to add days
what script did you start with and where are you stuck?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2023 12:03 AM
i am using before insert business rule only and i have use gludeDateTime to add days, here is the code i am using fro your reference,
Business rule :
var dur = current.u_minimum_lead_time; // minimum lead time is duration type
var glideObject = new GlideDateTime(dur);
glideObject.addDays(14);
current.u_minimum_lead_time = glideObject;
i am using the above code, but days are not populating as expected also i have to add 48 hours in different senario to the same field.