Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 12:33 AM
I have a BR which is runing on factory table. in fac record there is a field case. when fac record is rejected that case will be closed below BR is not working.
Action:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
gs.addInfoMessage("before "+current.parent.state);
current.parent.state = 3;
//current.parent.active = false;
current.update();
gs.addInfoMessage("after "+current.parent.state);
})(current, previous);
also tried:
info msg coming as
but case is not closed
Solved! Go to Solution.
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 01:02 AM
@Rosy14 Please update the script as follows.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
gs.addInfoMessage("before "+current.parent.state);
var parentRec = current.parent.getRefRecord();
parentRec.state = 3;
//current.parent.active = false;
parentRec.update();
gs.addInfoMessage("after "+current.parent.state);
})(current, previous);
Hope this helps.
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 01:02 AM
@Rosy14 Please update the script as follows.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
gs.addInfoMessage("before "+current.parent.state);
var parentRec = current.parent.getRefRecord();
parentRec.state = 3;
//current.parent.active = false;
parentRec.update();
gs.addInfoMessage("after "+current.parent.state);
})(current, previous);
Hope this helps.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 01:14 AM
Thanks. working now.