Skip to content

Commit c1f9860

Browse files
authored
Create script.js
1 parent 45d65e4 commit c1f9860

File tree

1 file changed

+19
-0
lines changed
  • Server-Side Components/Business Rules/Start a Flow

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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);

0 commit comments

Comments
 (0)