File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Server-Side Components/Business Rules/Preventing Recursive Updates from Integrations Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ ( function executeRule ( current , previous ) {
2+
3+ if ( current . isNewRecord ( ) || ! current . isValidRecord ( ) || current . operation ( ) == 'delete' ) {
4+ return ;
5+ }
6+ var fieldsToCheck = [ 'work_notes' , 'comments' , 'state' ] ;
7+ var allFieldsSame = true ;
8+ for ( var i = 0 ; i < fieldsToCheck . length ; i ++ ) {
9+ var field = fieldsToCheck [ i ] ;
10+ if ( current . changes . call ( current , field ) && current [ field ] . toString ( ) !== previous [ field ] . toString ( ) ) {
11+ allFieldsSame = false ;
12+ break ;
13+ }
14+ }
15+ if ( allFieldsSame ) {
16+ gs . info ( 'BR skipped redundant integration update for ' + current . sys_class_name + ': ' + current . number ) ;
17+ current . setAbortAction ( true ) ;
18+ }
19+
20+ } ) ( current , previous ) ;
You can’t perform that action at this time.
0 commit comments