Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all articles
Browse latest Browse all 2206

New Post: TriggerCollection.Add() adds the Trigger but sets the StartBoundary to Current DateTime.

$
0
0
I am fetching a Task with "n" number of Triggers, and wanting to add 1 more Trigger in the Task that becomes "n+1". So to achieve this I fetch the Task and get all the details in the TEmp_Task. Then, to the actual Task defined, I remove all the "n" number of Triggers and add the new "n+1" number of Triggers to it.

When I fetch all the Triggers from the original Task, I use the below line of code that changed the StartBoundary. Basically I create the list in my application. But for the sake of simplification I have mentioned only 1 Task.
Trigger t1_new = Curr_task.Definition.Triggers[0];
Now for the workaround, I am using
Trigger t1_new = (Trigger)Curr_task.Definition.Triggers[0].Clone();
Now using the above code I get the orignal StartBoundary and not the CurrentDate.

If there's a better then please suggest.

Also very much Thankfull to you that Clone() is available in the Trigger class.

Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>