IRtConnection.GetList Method (String, String, Int32, Int32)

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

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;