File tree Expand file tree Collapse file tree 4 files changed +58
-0
lines changed
Business Rules/Copy Worknotes
Script Includes/Filter record Expand file tree Collapse file tree 4 files changed +58
-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 ) ;
Original file line number Diff line number Diff line change 1+ This Script Include is useful for:
2+
3+ Filtering user records based on field from table data.
4+ Populating reference fields or dropdowns dynamically via GlideAjax.
5+ Client-side filtering based on server-side data logic.
Original file line number Diff line number Diff line change 1+ /*This Script Include is useful for:
2+
3+ Filtering user records based on field from table data.
4+ Populating reference fields or dropdowns dynamically via GlideAjax.
5+ Client-side filtering based on server-side data logic.*/
6+
7+ var < Script_include_name > = Class.create();
8+ < Script_include_name > .prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
9+ < functionname > : function() {
10+ var validID = [ ] ;
11+ var gr = new GlideAggregate ( "<table_name>" ) ;
12+ gr . addQuery ( "field" , "value" ) ;
13+ gr . addAggregate ( "COUNT" ) ;
14+ gr . groupBy ( "fieldname" ) ;
15+ gr . query ( ) ;
16+ while ( gr . next ( ) ) {
17+ var id = gr . getValue ( "fieldname" ) ;
18+
19+ validID . push ( id ) ;
20+
21+ }
22+
23+ var varname = "user_nameIN" + validID ;
24+ return varname ;
25+ } ,
26+ type: '< Script_include_name > '
27+ } ) ;
You can’t perform that action at this time.
0 commit comments