Calculated Value: How to add 5 days to a date field in a scoped application?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2020 05:00 PM
How to add 5 days to a date field in a scoped application, while using the calculated value field? This is what I currently have.
//Take current date in the site visit field and add 5 days, the result is then displayed on site visit report due date field.
var siteVisitDate = current.u_site_visit_date;
//add 5 days to site visit date field.
var reportDueDate = '';
return reportDueDate; // return the calculated value
After looking online I think I have to use the following but how would I use is it in my scenario?
Labels:
- Labels:
-
Scripting and Coding
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2020 05:29 PM
You can use addDaysLocalTime in Scoped App.
Refer below link and example
var siteVisitDate = new GlideDateTime(current.u_site_visit_date);
//add 5 days to site visit date field.
siteVisitDate.addDaysLocalTime(5);
return siteVisitDate; // return the calculated value
Please mark this response as correct or helpful if it assisted you with your question.