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


alasdair
2010-07-02T17:17:06Z
I want to run a job via the api. code is as below. Error is 'No overload for method 'Run' takes '1' arguments' however there appear to be 2 methods in the doc bit taking one argument.

Jobs jobs = server.Jobs;
JobClass jobToRun = null;
foreach (JobClass job in jobs.GetAll())
{
if (group == job.Group && jobName == job.Name)
{
jobToRun = job;
break;
}
}
if (jobToRun == null)
throw new Exception(String.Format("Could not find job {0}/{1}", group, jobName));
jobs.Run(jobToRun);
Sponsor
Forum information
alasdair
2010-07-02T18:47:57Z
ok I used .Net Reflector to find this method actually has the signature

Run(JobClass, Boolean)

unfortunately reflector seemed to have a problem disassembing, I tried setting the Boolean to false and that appears to work.

Could someone let me know
1. what is the Boolean arg?
2. Why is the help file out of date?
ErikC
2010-07-05T08:16:39Z
Hi alasdair,

I checked your signature and this is why there is a boolean:

It is for running the job with or without conditions.
true - with conditions.
false - without conditions.

I like the intellisense in VS, but the methods (from server.jobs) are not showing up. This helps a lot if we can see what methods / properties are there.

Regards,
Erik
Uses Visualcron since 2006.
Scroll to Top