Skip to content
Merged
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
4 changes: 4 additions & 0 deletions Server-Side Components/Business Rules/Copy Worknotes/read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Copy work notes to parent
Checks if work notes have changed in the current record.
If yes, it copies the latest journal entry to the parent’s work notes.
Sets the updated flag to true.
22 changes: 22 additions & 0 deletions Server-Side Components/Business Rules/Copy Worknotes/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/Copy work notes to parent
/* Checks if work notes have changed in the current record.
If yes, it copies the latest journal entry to the parent’s work notes.
Sets the updated flag to true.*//
(function executeRule(current, previous) {
if (!current.parent) return;

var parent = current.parent.getRefRecord();
if (!parent.isValidRecord()) return;

var updated = false;


if (current.work_notes.changes()) {
parent.work_notes = current.work_notes.getJournalEntry(1);
updated = true;
}

if (updated) {
parent.update();
}
})(current, previous);
Loading