We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06c5594 commit b44af5cCopy full SHA for b44af5c
Server-Side Components/Business Rules/Prevent closure if change tasks are open/Before_BR.js
@@ -0,0 +1,14 @@
1
+function executeRule(current, previous /*null when async*/){
2
+ if(current.close_code){
3
+ var taskGR = new GlideRecord('change_task');
4
+ taskGR.addQuery('change_request', current.sys_id);
5
+ taskGR.addQuery('state', '!=', '3') // Adjust as needed
6
+ taskGR.query();
7
+
8
+ if (taskGR.hasNext()){
9
+ gs.addErrorMessage('You cannot close this change request until all change tasks are closed.');
10
+ current.setAbortAction(true); // Prevent saving the form
11
+ }
12
13
14
+})(current, previous);
0 commit comments