The GetList method (String, String, Int32, Int32) returns a collection of ListItems for a specified list name, list format, host column index, and display column index.
Namespace – ABSuite.AccessLayer.Connector.Core
Assembly – Unisys.ABSuite.AccessLayer.Connector.Core (in Unisys.ABSuite.AccessLayer.Connector.Core.dll)
Syntax
IEnumerable<ListItem> GetList( string listName, string lFormat, int hostColumn, int displayColumn )
Arguments
listName – System.String
This argument provides the name of the required list, as designed in the AB Suite system.
lFormat – System.String
This argument provides the format string for the list, indicating the required columns to be used. For example, %2%3%4 uses columns 2, 3, and 4. This concatenates the content and returns it to the client for display. If this argument is not required it must be set to null.
hostColumn – System.Int32
This argument provides an integer value specifying the column used for the host value.
displayColumn – System.Int32
This argument provides an integer value specifying the column used for displaying the value.
Note: This is not used if a Format string is specified in the lFormat parameter.
Return Value
The return value is an IEnumerable of the type ListItem. This can be used to process the contents of a list or bind the list directly to a list-based control.
Note: This method should only be used with traditional lists that were created by using SendListDynamic or SendListStatic.
Using the IRtConnection Interface for the GetList Method (String, String, Int32, Int32)
The following code is an example of using the GetList (String, String, Int32, Int32) method:
// Load the SREP ispec that returns the SREP.SALESREP list LoadIspec("SREP"); IEnumerable<ListItem> myList = ABSConnection.DataHandler.GetList("SREP.SALESREP", "1%2", 1, 2); ListItem item = myList.First<ListItem>(); // Access the ListItem contents using the hc and dc properties // In this example, the dc contents contain a // concatenation of columns 1&2. string id = item.hc; string name = item.dc;