Active flag update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2020 12:56 AM
When RITM state is set to 'Closed Rejected' or 'Close with no action' in active field value is set to true however post close rejected or close with no action, active flag should be set as false.
Created business rule to override the value however unable to achieve.
Could you please help me in setting the active flag to false.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2020 01:01 AM
Hi,
In addition to above,
Refer below link,
https://hi.service-now.com/kb_view.do?sysparm_article=KB0697348
Thanks
Tanushree

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2020 01:04 AM
Hi Gautam,
Can you share the script you used for business rule that did not work once for a check & few alterations (if any).
Also, I feel there should not be need of script as it can simply be handled by Business Rules filter conditions & Action tab.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2020 01:21 AM
(function executeRule(current, previous /*null when async*/ ) {
var gr = new GlideRecord('sc_req_item');
gr.addEncodedQuery('state=13^active=true');
gr.query();
while (gr.next()) {
gr.active = false;
gr.update();
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2020 01:27 AM
Hi Gautam,
There is no need to write script for this, Check my previous comments you will find solution there.
Thanks,
Dhananjay.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2020 02:15 AM
Script seems to be fine. Hope business rule is running After Insert/Update & not before.
Also, can you check if there is some other business rule on the same table.