Skip to content

Commit 7748e27

Browse files
authored
Adding scipt action code
1 parent 50def5e commit 7748e27

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)