- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 02:15 AM
Hello,
In Utah I have created several HTML document template that I now want to delete.
I can't seem to find how. Templates are in Editing state.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 06:20 AM - edited 09-12-2023 06:24 AM
var docTemplateIds = [
'38e1ea601b59fd108cf1dce0b24bcbc8',
'1099aeac1b59fd108cf1dce0b24bcbbb',
'0ba9aeac1b59fd108cf1dce0b24bcbbf'
];
var gr = new GlideRecord('sn_doc_html_template');
gr.addQuery('sys_id', 'IN', docTemplateIds);
gr.query();
while(gr.next()) {
gs.info("Deleting Document Template : " + gr.name);
gr.setValue('state', 'draft');
gr.update();
}
Then I deleted them from the list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 05:09 AM
Hello Moonie !
Thanks for the answer.
These are exactly the documents I was mentioning. However, the delete button appears neither on the form nor in the contextual menu nor on the list view.
It seems, I can't delete Documents in Editing or Published state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 06:20 AM - edited 09-12-2023 06:24 AM
var docTemplateIds = [
'38e1ea601b59fd108cf1dce0b24bcbc8',
'1099aeac1b59fd108cf1dce0b24bcbbb',
'0ba9aeac1b59fd108cf1dce0b24bcbbf'
];
var gr = new GlideRecord('sn_doc_html_template');
gr.addQuery('sys_id', 'IN', docTemplateIds);
gr.query();
while(gr.next()) {
gs.info("Deleting Document Template : " + gr.name);
gr.setValue('state', 'draft');
gr.update();
}
Then I deleted them from the list.