Last updated work notes date and time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 03:01 AM
Hello developers,
how to get last updated date and time of a work notes on demand.
i am writing a background script here.
Can you please guide me on this.
Best Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 03:44 AM
Hey,
Please try :
var v= new GlideRecord('dmn_demand');
v.addQuery('number','DMND0001607');
v.query();
while(v.next()){
gs.print(v.sys_updated_on.getDisplayValue());
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 03:29 AM
Is it possible to check,
when the state got cancelled ? can i get this dates ?
Its not been saved any where so i have to figure out a way manually

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 03:39 AM
Hi,
So its generic Updated time. So, it may/may not necessarily be the time when state was cancelled. So, if there is a case where ticket was cancelled but comments/worknotes were updated later it will have the time updated.
So, any update made to ticket will get the Updated (sys_updated_on) time updated.
In your case of Cancel demand is there is no action that can be performed on the demand form then Yes, Updated (sys_updated_on) will have correct value i.e. the date-time when Demand was cancelled.
In addition, you can use v.sys_updated_on.getDisplayValue() to get exact date-time format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 03:48 AM
Hi,
That Updated On is generic field; any update happens the value changes.
But in case if you want when did record state changed from New to In Progress etc; that you can know if table is audited;
If table is audited you can right click on form and check history List
A) How to know if table is audited
Search in dictionary for this table a field of Type Collection; check if audit field is true
information for this is stored in History Table (sys_history_line)
you can get details of all fields which changes along with their old and new value
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2021 02:38 AM
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader