Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to make Requested_item Active to false

nameisnani
Mega Sage

Hi Team

 

In ritm  whose state was closed incomplete , closed complete , closed skipped .  But still active shows true instead of false.

Instead of making manually make active false , can anyone please suggest BG script or FIX script . 

 

SunilKumarPadh_0-1691038227263.png

 

Thanks in advance.

2 ACCEPTED SOLUTIONS

Ravi Chandra_K
Kilo Patron

Hello @nameisnani 

Greetings!

Since this is only making active false, you can bulk update from the list itself. If the no. of such records are less 

Ctrl+Shift and click on down arrow to select all the records in the list and update Active to False.

(Updated by will be your name if that's not a problem).

Please mark the answer as correct solution and helpful if helped.

 

Kind Regards,

Ravi chandra.

View solution in original post

@nameisnani 

 

Glad to see your problem has been resolved!

Your original ask was fix script/background script, which I have provided the same.

As per the new features of community, you can accept multiple solutions as correct!

 

View solution in original post

5 REPLIES 5

Ravi Chandra_K
Kilo Patron

Hi @nameisnani 

Greetings!

Try below script.

var ritm=new GlideRecord("sc_req_item");

ritm.addEncodedQuery("paste the query"); //paste query from filter

ritm.query();

while(ritm.next()){

ritm.setValue("Active", false);

}

Please mark the answer as correct solution and helpful if helped.

 

Kind Regards,

Ravi chandra.

Prince Arora
Tera Sage

@nameisnani 

 

Can you try this:

 

 

var gr = new GlideRecord("sc_req_item");

gr.addEncodedQuery("stateIN3,4,7^active=true");

gr.setLimit(1); //remove this for all the records

gr.query();

while(gr.next()){

gr.active = "false";

gr.update();

}

If my answer solved your issue, please mark my answer as  Correct & 👍Helpful based on the Impact.

@nameisnani 

 

Glad to see your problem has been resolved!

Your original ask was fix script/background script, which I have provided the same.

As per the new features of community, you can accept multiple solutions as correct!

 

Ravi Chandra_K
Kilo Patron

Hello @nameisnani 

Greetings!

Since this is only making active false, you can bulk update from the list itself. If the no. of such records are less 

Ctrl+Shift and click on down arrow to select all the records in the list and update Active to False.

(Updated by will be your name if that's not a problem).

Please mark the answer as correct solution and helpful if helped.

 

Kind Regards,

Ravi chandra.