Community forum

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


Guest
2010-05-13T22:18:03Z
Hi there,
I am playing with the API but so far I don't seem to be able to run the following jobs:

Monthly - I'd like to run a job to run on the 8th of every month

Weekly - I'd like a job to run every Monday, Tuesday, Wednesday, Thursday, Friday every week.

For my weekly job the following code adds the job but I don't know yet how to specify which days to run on:

Dim trClass As TriggerClass = jClass.AddTrigger(TimeClass.TimeTriggerT.Interval)
trClass.TTime.InitDate = vcDateTime
trClass.TTime.IntervalType = TimeClass.IntervalT.SpecificDaysOfTheWeek
trClass.TTime.SpecificType = TimeClass.SpecificT.Days
Sponsor
Forum information
Support
2010-05-13T22:50:30Z
You need to set which days:

Trigger.TTime.IntervalWeekDays(0) = true;

Where 0 is Monday.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Guest
2010-05-13T23:37:50Z
Perfect! This works, thanks.

Just need to know how to specify a specific day for Monthly, e.g., 8th day of every month.


Support
2010-05-14T00:11:39Z
Should be the IntervalDays property.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Guest
2010-05-14T00:35:17Z
excellent. thanks for your help. what is the maximum amount of scheduled jobs that can be added to visualcron? i may be looking at adding about 6,000+
Support
2010-05-14T09:19:54Z
Number of Jobs is really not a problem. The important thing is how you schedule them so you don't schedule them at the same time.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Guest
2010-05-14T19:37:46Z
thanks. i've seen a problem with windows task scheduler on server 2003 which limits the amount to approx 1100
Guest
2010-05-17T23:08:57Z
Support wrote:

Should be the IntervalDays property.



What about running monthly on the "Second Monday of the month"


ErikC
2010-05-18T08:57:29Z
mjisqm wrote:

What about running monthly on the "Second Monday of the month"


What you can do is create the desired trigger in VC and use VisualStudio to get this job and look at the trigger properties (use breakpoints). Than you know excactly how to set it up.

I tried this and got some strange behaviour in v5.5.9 . You might check this yourself. But it is easy to see all the properties this way.

Regards,
Erik
Uses Visualcron since 2006.
Guest
2010-05-31T19:26:35Z
Not sure how to enumerate the properties. I use the below code to connect to the only job I have in Visual Cron then I try to connect to its trigger:


For Each jc As JobClass In vcServer.Jobs.GetAll()
Dim trClass As TriggerClass = jc.Trigger(0)

Next


I've used a break point and tried the following in an immediate window:
?trclass.TTime.IntervalType
Referenced object 'trClass' has a value of 'Nothing'.

Also tried by connecting to jc.trigger(1)

Do you have some example code to connect to the trigger. So far I've been able to create jobs in code and add pretty much all triggers. Just having trouble reading the info back from Visual Cron in Visual Studio.
Thanks for all your help so far.

ErikC
2010-06-01T10:34:15Z
I see you are using VB.NET, I'm using C#, but the code must be readable and easily be changed to VB.NET:

foreach (JobClass myJob in s.Jobs.GetAll())
{
    foreach (TriggerClass myTrigger in myJob.Triggers)
    {
      //checkout the myTrigger object
    }    
}


If you set a break-point on the 2nd for-each loop, you can see all the properties of the trigger.

Regards
Erik
Uses Visualcron since 2006.
Guest
2010-06-01T20:12:39Z
This works well. Thanks.
Scroll to Top