File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Server-Side Components/Business Rules/Copy Worknotes Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 1+ / C o p y w o r k n o t e s t o p a r e n t
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 ) ;
You can’t perform that action at this time.
0 commit comments