Skip to content

Commit 43ef12f

Browse files
authored
Create BusinessRule.js
1 parent f906546 commit 43ef12f

File tree

1 file changed

+14
-0
lines changed
  • Server-Side Components/Business Rules/Track Tag Removal Using Delete Business Rule

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(function executeRule(current, previous /*null when async*/ ) {
2+
/*
3+
Fire this BR when a tag is removed/deleted from a record.
4+
Retrieve the tag name, the user who removed the tag, and the tag removal date.
5+
Update the above information onto the tag-referenced record in this example, In this example its incident record
6+
*/
7+
var updateRecord = new GlideRecord(current.table);
8+
if (updateRecord.get(current.table_key)) {
9+
var notes = "Tag Name:" + " " + current.label.getDisplayValue() + "\n" + "Tag Removed By:" + " " + current.sys_updated_by + "\n" + "Tag Removed On:" + " " + current.sys_updated_on;
10+
//updateRecord.setValue("work_notes", notes);
11+
updateRecord.work_notes = notes;
12+
updateRecord.update();
13+
}
14+
})(current, previous);

0 commit comments

Comments
 (0)