API Example Video

Skip to end of metadata
Go to start of metadata

This video shows an example of using the JobTracker API to read the list of accounts, create a job for an account, and add some job notes. We're using the API .NET object model and the free version of Microsoft Visual Basic. In about 8 minutes and 30 lines of code, this example shows you the basics of creating a powerful application that interacts with JobTracker through the API.

Here's the VB.NET example code from the video:

Imports Moraware.JobTrackerAPI3

Public Class Form1
    Dim conn As New Connection

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        conn.Url = "http://localhost/jobtracker/api.aspx"
        conn.UserName = "harry"
        conn.Password = "secret"
        conn.Connect()

        Dim acctList As List(Of Account)
        acctList = conn.GetAccounts(New FilterGetAccounts(FilterGetAccounts.GetAccountNamesStatusFilter_Enum.All), New PagingOptions())
        cboAccount.DataSource = acctList
        cboAccount.DisplayMember = "AccountName"

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim acct As Account = cboAccount.SelectedItem
        Dim newJob As New Job(acct.AccountId, txtJobName.Text, Connection.JobProcessId)
        newJob.Notes = txtJobNotes.Text

        Dim newJobId As Integer
        newJobId = conn.CreateJob(newJob)

        Me.WebBrowser1.Navigate("http://localhost/jobtracker/d.asp?wp=2&jobid=" & newJobId.ToString)

    End Sub
End Class

Labels

video video Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.