File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
GlideRecord/Track any update on record Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ ( function executeRule ( current , previous /*null when async*/ ) {
2+
3+ // Add your code here
4+ for ( var x in current ) {
5+ if ( x != 'comments' && x != 'sys_mod_count' && x != 'sys_updated_by' && x != 'sys_updated_on' ) {
6+ if ( current [ x ] != previous [ x ] ) {
7+ var currVal = current [ x ] . getDisplayValue ( ) ;
8+ if ( current [ x ] . getDisplayValue ( ) == '' ) {
9+ currVal = 'empty' ;
10+ }
11+ if ( x == 'description' ) {
12+ current . comments = current [ x ] . getLabel ( ) + ' has been updated to ' + currVal ;
13+ }
14+ else {
15+ var prev = previous [ x ] . getDisplayValue ( ) ;
16+ if ( previous [ x ] . getDisplayValue ( ) == '' ) {
17+ prev = 'empty' ;
18+ }
19+ current . comments = current [ x ] . getLabel ( ) + ' has been updated to ' + currVal + ' from ' + prev ;
20+ }
21+ }
22+ }
23+ }
24+ } ) ( current , previous ) ;
You can’t perform that action at this time.
0 commit comments