How do i stop a schedule script if there is no can...
# suitescript
s
How do i stop a schedule script if there is no cancel button
d
If it's already running? inactivate the script, delete/undeploy the deployment If you're wanting to build in a kill switch, have the script look up a checkbox value from some custom record that you control
s
Hmm I did undeploy it but it stopped after about 30 mins, yes i am looking for a kill switch that I can control, this script runs on sales order to update allocation (Commit schedule)
d
yeah, add some
if (_myCustomKillswitchCheckbox_ === true) return;
in critical places. Especially in for loops that take a long time to process
but I don't think you can use the schedule script's parameters for the checkbox, as those params are cached when the script is called So have a standalone custom record, with a known internal id so you can just
search.lookupFields(…)
to get your killswitch
s
hmm i think it's getting too technical for me. i think undeploy would work, i will just have to tell them it will stop after the current cycle it is in