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.


Rory
  •  Rory
  • No customer Topic Starter
2008-09-30T01:57:38Z
Hi, how can I inactivate/delete a job using the API?
I tried this but don't work:
//
JobClass jobClassToInactivate = null;
JobClass jobClassToRemove = null;

foreach (JobClass jobClass in server.Jobs.GetAll())
{
if (jobClass.Id == "GuidToInactivate")
{
jobClassToInactivate = jobClass;
}

if (jobClass.Id == "GuidToRemove")
{
jobClassToRemove = jobClass;
}
}

server.Jobs.Inactivate(jobClassToInactivate);
server.Jobs.Remove(jobClassToRemove);
//

the Inactivate method pass, but checking with VCClient the "Activate (when added)" checkbox is checked
and the Remove method throws Null exception even if jobClassToRemove isn't null (jobClassToRemove.Id != null too)

Please what i'm doing wrong? The VC version that i'm using is 4.8.4

Thanks in advance

Rory
Sponsor
Forum information
Support
2008-09-30T09:41:31Z
You should upgrade to the latest version. The API has been totally reworked.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Rory
  •  Rory
  • No customer Topic Starter
2008-09-30T18:34:26Z
Ok, it means that our current code must change?

Rory
Support
2008-09-30T19:16:40Z
Not much. Only change you will find is that the AddUpdate is divided into Add and Update. Besides that you will have access to a lot of more functions and many bugs have been fixed.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
2008-09-30T19:22:16Z
Could be, some of the API code is refined.
Not all the things you could do with the client you could do with the API support (with your 'old' client version). Now (currently 4.9.26) it should be supported all the way.
I had to do some recode concerning changing passwords within connections. I encountered minor changes in my situation.

[edit]

Support wrote:

Not much. Only change you will find is that the AddUpdate is divided into Add and Update. Besides that you will have access to a lot of more functions and many bugs have been fixed.



That was the case in my scenario!
[/edit]

Regards,
Erik
Uses Visualcron since 2006.
Scroll to Top