new GlideDateTime(current.sys_created_on not copying to variables and posting back to records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 11:06 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 11:30 AM
There are a few things to point out with your script. Take a look at the comments below.
(function executeRule(current, previous /*null when async*/ ) {
var gcdt = new GlideDateTime(current.sys_created_on);
var lreview = new GlideDateTime(Current.u_last_review); // should be current with a lowercase c
var anreview = new GlideDateTime(current.u_annual_standard_change_review_date);
// set variable gcdt to current created date in system
lreview = gcdt;
anreview = gcdt;
// where are you setting the custom fields?
// current.fieldName = lreview;
// current.fieldName = anreview;
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 01:04 PM
I added them on the form as new fields. it's all on the current form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 11:34 AM
Hi @Jeffrey Barton ,
Hope you are doing great.
or try using below code :
Reason being - GlideDateTime accpets date in string format in input parameter.
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 01:15 PM
it still didn't update the fields.