Forum
»
Support
»
API
»
Reset triggers with API
  Rank: Paid supportJoined: 10/18/2016(UTC) Posts: 23
Was thanked: 3 time(s) in 3 post(s)
|
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 Edited by moderator Tuesday, December 11, 2018 7:08:02 PM(UTC)
| Reason: Not specified
|
|
|
|
  Rank: Official supportJoined: 2/23/2008(UTC) Posts: 11,222
Thanks: 874 times Was thanked: 446 time(s) in 424 post(s)
|
You do this; Code:job.ResetTriggerDepedency = true;
server.Jobs.Update(job);
|
|
|
|
|
  Rank: Paid supportJoined: 10/18/2016(UTC) Posts: 23
Was thanked: 3 time(s) in 3 post(s)
|
Thank you I will check that
|
|
|
|
  Rank: Paid supportJoined: 10/18/2016(UTC) Posts: 23
Was thanked: 3 time(s) in 3 post(s)
|
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 |
Guest (2)
|
Forum
»
Support
»
API
»
Reset triggers with API
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.