File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Server-Side Components/Business Rules/Dynamic GlideList Field Sync Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1+ This code_snippet.js script sync all related assignment groups when a record’s department changes.
Original file line number Diff line number Diff line change 1+ // This script sync all related assignment groups when a record’s department changes and this business rule runs After Update
2+ ( function executeRule ( current , previous ) {
3+ if ( current . department . changes ( ) ) {
4+ var grp = new GlideRecord ( 'sys_user_group' ) ;
5+ grp . addQuery ( 'u_department' , current . department ) ;
6+ grp . query ( ) ;
7+ var list = [ ] ;
8+ while ( grp . next ( ) ) list . push ( grp . sys_id . toString ( ) ) ;
9+ current . assignment_group = list . join ( ',' ) ;
10+ current . update ( ) ;
11+ }
12+ } ) ( current , previous ) ;
You can’t perform that action at this time.
0 commit comments