We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50def5e commit 7748e27Copy full SHA for 7748e27
Server-Side Components/Script Actions/Attachment Downloads Logger/scriptActionCode.js
@@ -0,0 +1,11 @@
1
+var recordSysId = current.table_sys_id; //get the sys_id of the record to which the attachment is linked
2
+var userSysId = event.user_id; //the user who read the attachment
3
+var userName = event.user_name; // get the user name
4
+var attachmentName = event.parm1; //get the attachment name
5
+var tableName = current.table_name; //get the table name
6
+
7
+var gr = new GlideRecord(tableName);
8
+if (gr.get(recordSysId)) {
9
+ gr.work_notes = `Attachment "${attachmentName}" was downloaded by user "${userName}" on ${new GlideDateTime().getDisplayValue()}.`;
10
+ gr.update();
11
+}
0 commit comments