Delete a job - VisualCron - Forum

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


Robertom
10 years ago
I'm trying to delete all job of a group with this code:

Dim wConn = New VisualCronAPI.Connection
Using wClient = New VisualCronAPI.Client
    Dim wServer = wClient.Connect(wConn)
    For Each wjobs As VisualCron.JobClass In wServer.Jobs.GetAll()
        If wjobs.Group = "TEST" Then
            wServer.Jobs.DeActivate(wjobs.Name)
            wServer.Jobs.Remove(wjobs.Name)
        End If
    Next
End Using


...but nothing happens.
Where is the mistake?

Thanx
Sponsor
Forum information
Support
10 years ago
I see no problem with that. But why do you want to deactivate it first. I suggest deleting it right away.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Robertom
10 years ago
Resolved!

The error was here
wServer.Jobs.Remove(wjobs.Name)

"Remove" need the ID of the job.
Support
10 years ago
You are right - missed that!
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top