How to stop SLA without removing setworkflow(false)

thaduri sai
Tera Contributor

Hi Team,

We have a requirement to put on "On-Hold" state of demand records. We have return background script to update the state into on-hold. 

Script:- 

Var gr = new GlideRecord("dmn_demand");

gr.addEncodedQuery("sys_class_name=dmn_demand^numberINDMND.....")

gr.query();

While(gr._next()) {

gr.state = "12";

gr.u_on_hold_reason = "10";

gr.setWorkflow(false);

gr.update();

}

This above code working fine as expected. But the demand records SLA is still running.

How to stop SLA without removing the setworkflow(false);

 

Thanks for the advance.

 

Thanks,

Sai

 

2 REPLIES 2

Dhananjay Pawar
Kilo Sage

Hi,

setWorkflow(false) is to stop the execution of BR, meaning whatever BRs are there on that table those will not get trigger if we use setWorkflow(false).

 

Thanks.

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @thaduri sai ,

 

You need need a script to exclusively stop SLA for the demand. This script will only stop BR and other Background activities to execute.

 

I hope this helps... 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect