Change the "deleted attachment" message in "Ticket Attachments"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-23-2023 02:09 AM
Hi everyone Im trying to change the "deleted attachment" message in "Ticket Attachments", to show which attachment got deleted, but I dont know how to get the attachment, can anyone help with this ?
Code:
if (input && input.action == "deleted") {
gr.comments = input.action + " attachment";
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-23-2023 08:39 AM - edited ā10-23-2023 08:42 AM
What it does now is, it only runs when there is more than 1 attachment and it always get's the first one.
For example:
If I have:
test2.txt
test.txt
And delete the "test2.txt" it returns: "Deleted attachment: test.txt"
if I delete the "test1.txt" it return: "Deleted attachment: test2.txt"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-23-2023 07:57 AM
then probably it's wrong table name
what came in data.table?
what came in data.sys_id? Is that a sysId of the record on which file is present or sysId of sys_attachment?
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-23-2023 08:26 AM - edited ā10-23-2023 08:42 AM
What it does now is, it only runs when there is more than 1 attachment and it always get's the first one.
For example:
If I have:
test2.txt
test.txt
And delete the "test2.txt" it returns: "Deleted attachment: test.txt"
if I delete the "test1.txt" it return: "Deleted attachment: test2.txt"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-24-2023 08:33 PM
just use while loop to show all the messages
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader