How to delete field change entry in Activities
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 03:00 AM
Hello,
I have changed one field , so the histry has been tracked in activities.
Is there a way to delete the activity in servicenow?
I can see there are some steps provided for deleting the journal entries. But this is not realetd to any worknotes/comments
This is a field entry changes from past to present.
Please suggest me.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 03:15 AM
Hi Lalitha,
Can you explain what is required?
Field entry changed?
Regards
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-19-2020 03:38 AM
Hi,
Goto Application Navigator and type: sys_history_line.list and find the sys_id of the activity you need to delete.
Go to Background scripts and run the below script
var gr = new GlideRecord('sys_history_line')
gr.addQuery('sys_id','sysid of the record which your want to delete'); //Search for it from the sys_history_line table
gr.query();
if(gr.next()){
gr.deleteRecord();
}
I don't know this the best practice or not, But it will work.
Hope this helps!
If you have any more questions, please let me know.
If I have answered your question, please mark my response as correct and helpful.
Thanks,
Sriram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2020 08:45 AM
Hi Lalitha,
Hope you are doing good.
If I have answered your question, please mark my response as correct and helpful. so that this thread can be closed and others can be benefited from this.
Thanks
Sriram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2020 08:40 AM
Hi Lalitha,
Hope you are doing good.
Let me know if that answered your question.
If so, please mark an appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Thanks
Sriram