Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions GlideRecord/Track any update on record/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Whenever there is any update on the current record except the comments or updated that will be tracked in the Activity log by using Before update business rule
24 changes: 24 additions & 0 deletions GlideRecord/Track any update on record/code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(function executeRule(current, previous /*null when async*/) {

// Add your code here
for (var x in current){
if(x!='comments'&&x!='sys_mod_count'&&x!='sys_updated_by'&&x!='sys_updated_on'){
if (current[x] != previous[x]) {
var currVal=current[x].getDisplayValue();
if(current[x].getDisplayValue()==''){
currVal='empty';
}
if(x=='description'){
current.comments=current[x].getLabel() +' has been updated to ' +currVal;
}
else{
var prev=previous[x].getDisplayValue();
if(previous[x].getDisplayValue()==''){
prev='empty';
}
current.comments=current[x].getLabel() +' has been updated to ' +currVal+' from '+prev;
}
}
}
}
})(current, previous);
Loading