File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Server-Side Components/Business Rules/Start a Flow Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ //Table: Change Task
2+ // When: After Delete
3+ // When any of the associated change tasks are deleted, calling the flow asynchronously to make the updates.
4+ ( function executeRule ( current , previous /*null when async*/ ) {
5+ try {
6+ var chgTask = new GlideRecord ( 'change_task' ) ;
7+ chgTask . addQuery ( 'change_request' , current . change_request ) ;
8+ chgTask . query ( ) ;
9+ if ( chgTask . next ( ) ) {
10+ var inputs = { } ;
11+ inputs [ 'current' ] = chgTask ;
12+ inputs [ 'table_name' ] = 'change_task' ;
13+ sn_fd . FlowAPI . getRunner ( ) . flow ( 'global.calculateActualStartEndDates' ) . inBackground ( ) . withInputs ( inputs ) . run ( ) ;
14+ }
15+ } catch ( ex ) {
16+ var message = ex . getMessage ( ) ;
17+ gs . error ( message ) ;
18+ }
19+ } ) ( current , previous ) ;
You can’t perform that action at this time.
0 commit comments