My latest project with Automise, I am trying to schedule tasks, based on dates and times comming from a database. Grabbing this is ne sweat, but scheduling the task on a date and time stored in variables has turned out to be a challenge. Is this possible at all?
If you use the Add Scheduled Task action, you can change the StartDate from script: Action.StartDate = TheNewDate
If you’re using the Schedule Add action, then it’s a lot harder as you have to set hours, minutes, days separately, eg. Action.PropertyStore.absDay = TheDay
Apologies for resurrecting an old thread, but I’ve got a strange error whilst trying to do this. Using a bit of SQL to get a datetime value , then set off a new scheduled task with that value. The date is always 15/03/2029.
NextRunDate is a date variableuse dto capture the output of the ADO Execute SQL action
The code in Add Scheduled Task: Action.StartDate = datevalue(nextrundate) action.AbsoluteStartTime = nextrundate action.UseStartDate = true
The log:
Set next time job should run Status: Completed Date: 07/08/2014 Time: 13:01:36:849 End: 13:01:36:866 Duration: 00:00:00:017
Action Messages: 07/08/2014 13:03:37
Output Monitor : 1 matches for “*” written to variable NextRunDate
Its hard to see what the value of the date would be from the output monitor. The output monitor will take the text from the match and place it into the variable. From memory the conversion from text to datetime is very particular about the date format.
Please send us a cut down project which shows the issue to support. From there I will be able to see more clearly what is occurring and either fix the issue or give you a solution which works.