Class ListItemLookupHelper
This helper is used by the archives to quickly look up the value (name, tooltip, whatever) corresponding to a list item. It will take either a table number or a list name, look up the item, and cache the result. Various caching and override mechanisms are used to make lookups as fast as possible, and to work with some unconventional 'lists' like contact or person.
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.dll
Syntax
[SoInject("Database")]
public class ListItemLookupHelper : Object
Methods
Flush()
This helper is used by the archives to quickly look up the value (name, tooltip, whatever) corresponding to a list item. It will take either a table number or a list name, look up the item, and cache the result. Various caching and override mechanisms are used to make lookups as fast as possible, and to work with some unconventional 'lists' like contact or person.
Declaration
public void Flush()
GetCurrent()
This helper is used by the archives to quickly look up the value (name, tooltip, whatever) corresponding to a list item. It will take either a table number or a list name, look up the item, and cache the result. Various caching and override mechanisms are used to make lookups as fast as possible, and to work with some unconventional 'lists' like contact or person.
Declaration
public static ListItemLookupHelper GetCurrent()
Returns
Type | Description |
---|---|
ListItemLookupHelper |
LookupItem(Int32, Int32)
Look up an SoList item by list table number and ID. This overload works for lists that directly
correspond to actual database tables, with the added restriction that those tables must have
SoTable.
Declaration
public ISoListItem LookupItem(int listTableNumber, int id)
Parameters
Type | Name | Description |
---|---|---|
Int32 | listTableNumber | List table number in database |
Int32 | id | ID to look up |
Returns
Type | Description |
---|---|
ISoListItem | List item corresponding to table/ID, or blank |
LookupItem(String, Int32)
Look up an SoList item by list name and ID. This overload works for ANY list that the SuperOffice.CRM.Lists.SoListProviderFactory knows about, regardless of the origin of that list.
If the list is not found, or the list item does not exist, the generic blank item is returned.Declaration
public ISoListItem LookupItem(string listName, int id)
Parameters
Type | Name | Description |
---|---|---|
String | listName | |
Int32 | id | ID to look up |
Returns
Type | Description |
---|---|
ISoListItem | List item corresponding to table/ID, or blank |
LookupItem(String, String, String)
Look up an item based on a string key instead of the usual int primarykey
Declaration
public ISoListItem LookupItem(string listName, string listAdditionalInfo, string key)
Parameters
Type | Name | Description |
---|---|---|
String | listName | List name, to be passed on to the list provider factory |
String | listAdditionalInfo | |
String | key | Key, matched to the ExtraInfo of each item |
Returns
Type | Description |
---|---|
ISoListItem |
Remarks
Some lists (ERP Connector related) use a string key instead of an int; the reason is that the source of the list may be external to the superoffice database. Such lists must have normal ISoListProviders implemented, and provide their key in the ExtraInfo field of each item.
This method lazy-loads the entire list of first reference, and performs dictionary looks later on. The cache is only cleared on Flush(). If the ExtraInfo keys are not in fact unique, then the last one wins (no crashes)