
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2020 02:46 AM
Dear SNC,
how can I add seconds with Gliderecord to an existing record?
Idea
var gr = new GlideRecord("incident");
gr.addQuery("sys_id", "9b8eb0c94f71f20022c92eff0310c222");
gr.query();
if (gr.next()) {
gr.overdue = gr.overdue.addSeconds(3600);
gr.update;
}
Thank you in advance,
Simon
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2020 03:10 AM
Try this code. This will work.
var gr = new GlideRecord("incident");
gr.addQuery("sys_id", "9b8eb0c94f71f20022c92eff0310c222");
gr.query();
if (gr.next()) {
var gdt = new GlideDateTime(gr.overdue);
gdt.addSeconds(3600);
gr.overdue = gdt;
gr.update;
}
Mark the comment as correct/helpful if it helps to solve the problem.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2020 05:06 AM
As it seems to have an typo for gr.update which should be gr.update()
Note: You can have only 1 answer correct so mark the one that you found more helpful & would help future readers to be benefitted from.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2020 06:52 AM
I saw that typo, thank you very much!