We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1106276 commit de666b7Copy full SHA for de666b7
Server-Side Components/Business Rules/Copy Worknotes/script.js
@@ -0,0 +1,22 @@
1
+/Copy work notes to parent
2
+/* Checks if work notes have changed in the current record.
3
+If yes, it copies the latest journal entry to the parent’s work notes.
4
+Sets the updated flag to true.*//
5
+(function executeRule(current, previous) {
6
+ if (!current.parent) return;
7
+
8
+ var parent = current.parent.getRefRecord();
9
+ if (!parent.isValidRecord()) return;
10
11
+ var updated = false;
12
13
14
+ if (current.work_notes.changes()) {
15
+ parent.work_notes = current.work_notes.getJournalEntry(1);
16
+ updated = true;
17
+ }
18
19
+ if (updated) {
20
+ parent.update();
21
22
+})(current, previous);
0 commit comments