Background script to make a case inactive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2017 01:49 AM
HI All,
Can anyone guide me on this.
Thanks in Advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2017 01:53 AM
Hi Sachin,
Manually get the sys_id of the record.
Then run the following query in your background script:-
var gr = new GlideRecord('Your case table name here');
gr.addQuery('sys_id', 'the sys id you manually copied');
gr.query();
while(gr.next())
{
gr.active = 'false';
gr.state = 'Closed'; // This is if you have a state on case and have a closed state
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2017 01:54 AM
Hi Sachin,
Try this out, it will make all records inactive
var gr = new GlideRecord('your_case_table'); //Add your case table name here
gr.query();
while(gr.next()){
gr.active = false;
gr.update();
}
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2017 01:57 AM
var gr = new GlideRecord('your_case_table'); //Add your case table name here
gr.addQuery() // Your condition
gr.query();
while(gr.next()){
gr.active = false;
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2017 02:10 AM
HI Sachin,
Var gr = new GlideRecord("table name");
if(gr.get("sys_id of the record")) // if you are doing single record or doing for multiple records use gr.addQuery("your condition");
{
gr.active = fasle;
gr.autoSysFields(false);
gr.setWorkflow("false");
gr.state = "closed";
gr.update();
}
PS: Hit like, Helpful or Correct depending on the impact of the response