We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af88ba1 commit c5c788fCopy full SHA for c5c788f
1 file changed
Server-Side Components/Business Rules/Preventing Recursive Updates from Integrations/prevent_continous_update.js
@@ -0,0 +1,20 @@
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);
0 commit comments