Active flag update

Gautam Gattu
Mega Expert

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.

15 REPLIES 15

Tanushree Doiph
Mega Guru

Hi,

In addition to above,

Refer below link,

https://hi.service-now.com/kb_view.do?sysparm_article=KB0697348

 

Thanks

Tanushree

Jaspal Singh
Mega Patron
Mega Patron

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.

(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);

Hi Gautam,

There is no need to write script for this, Check my previous comments you will find solution there.

Thanks,

Dhananjay.

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.