Home

Using the api from vb.net

Create an instance of the webservice client and log in

Dim ws As New VtigerWebservice.Webservice("http://vtiger-site/webservice.php", "user", "access key")
ws.Login()

How to get the Access Key

Retrieve the names of the modules

Dim types As Dictionary(Of string,
VtigerWebservice.Webservice.ListTypeInfo) = ws.ListTypes()
For Each item As KeyValuePair(Of string, VtigerWebservice.Webservice.ListTypeInfo) In types
    Console.WriteLine(item.Key)
Next

Describe the structure of a module

Dim desc As VtigerWebservice.Webservice.DescribeInfo = ws.Describe("Potentials")
Console.WriteLine(desc.idPrefix)

Retrieve an existing record

Dim obj As Dictionary(Of String, Object) = ws.Retrieve("3x1117246")
For Each item As KeyValuePair(Of String, Object) In obj
    Console.WriteLine(item.Key)
Next
Console.WriteLine(obj.Item("id"))

Update an existing record

Dim obj As Dictionary(Of String, Object) = ws.Retrieve("3x1117246")
For Each item As KeyValuePair(Of String, Object) In obj
    Console.WriteLine(item.Key)
Next
obj.Add("accountname", "New Name")
ws.Update(obj)

Create a new record

Dim newObj As New Dictionary(Of String, Object)
newObj.Add("accountname", "New Account")
newObj.Add("assigned_user_id", ws.UserId)
ws.Create("Accounts", newObj)

Run a query on vtiger

Dim result As  List(Of Dictionary(Of string, object)) =
ws.Query("select * from Accounts;")
For Each item As Dictionary(Of string, object) In result
    Console.WriteLine(item.Item("id"))
Next

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.