- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 08:58 AM
Hi,
I have a requirement where I have a case record in a custom scope application(customer service). I have to add two days to the created field for the record, and set the new date to a custom field, "updated date". For example, if the created date is 2024-04-17 13:10:122 then after adding two days it should be 2024-04-19 13:10:122.
How can i achieve this through script for a scoped application?
Kindly, suggest!
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 10:03 AM
You have a few options for this with the Scoped GlideDateTime class (docs here). You could use the function addDaysLocalTime or addDaysUTC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 10:03 AM
You have a few options for this with the Scoped GlideDateTime class (docs here). You could use the function addDaysLocalTime or addDaysUTC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 10:48 AM - edited 04-17-2024 10:51 AM
Hi @SK41 ,
You have to use addDaysUTC() or addDaysLocalTime() for scoped application.
Follow this link for more information :GlideDateTime - Scoped (servicenow.com)
Please refer below screenshot & use 'addDaysUTC()' or 'addDaysLocalTime() ' for scoped application instead of addDays().
Please mark helpful & accept the answer if it's really worthy for you.