Delete a job - VisualCron - Forum

Community forum

Robertom
2015-10-23T09:31:36Z
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
Support
2015-10-23T09:44:08Z
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
2015-10-23T14:42:09Z
Resolved!

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

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