Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


dabelenda
2018-12-10T08:55:42Z
Hello,

I want to reset "programatically" triggers to 0, but it doesn't seam to work as expected.
Could you please direct me to the best way to reset a job trigger

I have the following code witch reset correctely in the GUI but some time doesn't seam to work correctly "behind the scene":
Quote:


...
job.ResetToWaiting();
foreach(var trigger in job.Triggers)
{
trigger.TriggerCount = 0;
server.Jobs.Triggers.Update(job, trigger);
}
job.ResetTriggerDepedency = true;
...



Can you confirm if this snippet is the correct way to do it?

Thank you
Sponsor
Forum information
Support
2018-12-11T18:07:51Z
You do this;

job.ResetTriggerDepedency = true;
server.Jobs.Update(job);

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
dabelenda
2018-12-14T09:35:20Z
Thank you I will check that
dabelenda
2018-12-17T13:16:54Z
Hello,

I still have an extraneous behaviour, when I reset the triggers and list the triggers afterwards it shows me that some trigger were triggered two times (which seems correct because it's a trigger on time and the job waits for another one) but in the GUI it shows me only 1 occurence.

Could it be an error in the GUI or do you think my show triggers could be wrong?

I simply list the trigger occurences with the trigger.TriggerCount attribute.
Users browsing this topic
Scroll to Top