Cancel task SLA default workflow from business rule:

saddamstarr
Tera Contributor

HI All,

I have a customized business rule from some SLA will get cancelled, But However the cancelled SLA's clock is not stopping, because cancelled SLA's workflow are in stil progress.

So i need to cancel the workflow from my business rule.

Please find the BR rule some code which is not cancelling the SLA workflow:

find_real_file.png

kindly provide your input to how i can change my code to cancel the default sla workflow.

Regards,

Saddam

1 ACCEPTED SOLUTION

Hi Saddam,



In your case current is task_sla record. So please try



var workflow = new Workflow();


workflow.cancel(task_sla_gr);



Also remove the line of code related to task_sla_gr.setWorkflow(false);



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

13 REPLIES 13

Thanks Alikutty,



Thanks for you info,


However the SLA are getting cancelled from above script but the timer is not stopping for cancelled SLA.


Could you give some input on this where we need to stop cancelled SLA clock.



Thanks,


Saddam


The default SLA workflow is used to send notifications to users, If you need to stop timer then the stop conditions defined on SLA should be executed and I doubt whether you can stop timer by cancelling SLA.



If I have answered your initial question on how to cancel workflows, can you please mark my answer as correct.



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


HI Thanks for responses:




The SLA's clock is not stopping which was cancelled by customized business rule.



My customized business rule code:



find_real_file.png


the above code is resetting corresponding sla Stage to cancelled and its inactive but however SLA clock is not stopping for this.




Kindly help me on this how we can stop the clock for these SLA's which are cancelled by above business rule.



Regards,


Saddam


Could you confirm the OOB functionality means from which   the OOB SLA;s are getting cancelled and clock is stop, so i can follow the same for my customized one as well.


You can set the stop condition on your SLA as OR "Stage is cancelled" and then set the stage in your code and it will work.



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response