Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Document Client/Matter Query API
Matt999
Hello -
I need to retrieve the Client/Matter info for a desksite document - I've read through the manuals, and found some examples that are similar to what I need to do.... problem is the examples are in C++ (C#)?.
I was wondering if anyone could point me to some sample vb 6 or vb.net code that uses the API to pull client/matter.
Thanks
Matt
Find more posts tagged with
Comments
jny
This code example demonstrates how to find the client and matter exactly matches the values set in strClient and strMatter.
Note: you do not have to search by exact match. You may pass in an empty string to the search method and select a different imSearchAttributeType enum. There are four:
Const imSearchBoth = 3
Const imSearchExactMatch = 4
Const imSearchFullName = 2
Const imSearchID = 1
[VB]
Option Explicit
Private Const SERVER_NAME = "[SERVERNAME]"
Private Sub Form_Load()
Dim sess As IManSession
Set sess = TrustedLogin
' Search custom1 for an exact match
Dim cust1Results As IManCustomAttributes
Dim client As IManCustomAttribute
Dim cust2Results As IManCustomAttributes
Dim matter As IManCustomAttribute
Dim strClient, strMatter As String
strClient = "C1A" ' (ex: "C1A")
strMatter = "M2A" ' (ex: "M2A")
On Error GoTo Oops
Set cust1Results = sess.PreferredDatabase.SearchCustomAttributes(strClient, imProfileCustom1, imSearchExactMatch, imSearchEnabledOnly, True)
If False = cust1Results.Empty Then
' results should only return one client
If cust1Results.Count = 1 Then
Set client = cust1Results.ItemByName(strClient)
' Get an exact match of custom2
Set cust2Results = client.GetChildList(strMatter, imSearchExactMatch, imSearchEnabledOnly, True)
If False = cust2Results.Empty Then
' results should only return one matter
If cust2Results.Count = 1 Then
Set matter = cust2Results.ItemByName(strMatter)
End If
End If
End If
End If
GoTo Cleanup
Oops:
MsgBox Err.Description
Err.Clear
GoTo Cleanup
Cleanup:
Logout sess
Set cust1Results = Nothing
Set client = Nothing
Set cust2Results = Nothing
Set matter = Nothing
Set sess = Nothing
End
End Sub
Private Function TrustedLogin() As IManSession
Dim dms As New ManDMS
Dim sess As IManSession
Set sess = dms.Sessions.Add(SERVER_NAME)
sess.TrustedLogin
If sess.Connected Then Set TrustedLogin = sess
End Function
Private Sub Logout(sess As IManSession)
If Not sess Is Nothing And True = sess.Connected Then
sess.Logout
sess.dms.Close
End If
End Sub
Matt999
jny -
Thx Much!