Click or drag to resize

IDatabaseGetListItemByName Method

Return a given List Item in a given list table based on the text of the item rather than the id.

Returns IListTextItems containing all the items in the given table, filtered and grouped according to the current user's group, but without the headings.

Note that items that are repeated under more than one heading will be repeated in the list.

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
IListTextItem GetListItemByName(
	SOTableId TableId,
	string Name
)

Parameters

TableId
Type: SuperOffice.COM.SuperOfficeDBSOTableId
the numeric database identifier
Name
Type: SystemString

Return Value

Type: IListTextItem
ListTextItems – a collection of ListText objects IListTextItem - The name field of a table. (e.g what is category_id=1 called)
Examples

Get information from the DocTmpl table

This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.

VB
dim objso
dim objlistitems
set objso = CreateObject("superofficedb.database")
If not (objSO is nothing)  then
    objso.login "<username>", "<password>"
    set  objlistitems = objso.getlist(130)
    for each item in objlistitems
        msgbox item.text
    next
else
    msgbox "unable to connect to database"
end if
set objso = nothing

Get the text string that represents the category of current contact

This text may be copied to the notepad, and saved as a *.vbs file. You need a running CRM win client to make it work. (This example uses the SuperOffice COM application library and not the SuperOffice db library interface).

VB
dim objso 
dim objcl 
set objso =  CreateObject("superoffice.application")
If not (objSO is nothing) Then
    set  contact = objso.currentcontact
    cat_id  = contact.category.id
    set  objcl = objso.database.getlistitem (64,cat_id)
    msgbox  "contact 2 has category " & objcl.text
else
    msgbox "could not log in"
end if
set objso = nothing

Get the list item

VB
dim objSO
set objSO = createobject("SuperOfficeDB.Database") 
If not (objSO is nothing) Then
    objSO.login "<username>", "<password>" 
    Set myListTextItem = objSO.GetListItemByName(enTableDocTmpl, "Memo")
    msg = "Template 'Memo' have the following doctmpl_id=" & myListTextItem.Id & " with tooltip: " & myListTextItem.Tooltip & vbCrLf

    Set myListTextItem = objSO.GetListItemByName(enTableCategory, "Customer")
    msg = msg & "Category 'customer' have the category_id=" & myListTextItem.Id & vbCrLf

    Set myListTextItem = objSO.GetListItemByName(enTablePersPos, "Sales")
    msg = msg & "Person position 'sales' have perspos_id=" & myListTextItem.Id & vbCrLf

    MsgBox msg

else
    msgbox "Unable to log in"
end if
set objSO = Nothing

See Also