List options

Each list has numerous options that can be specified by the user, such as which sections of the list are displayed, and their corresponding sizes. These options are stored in a table. A default set of options must be created for the list. This is done by the CreateListOptionsData procedure. The following is the CreateListOptionsData procedure for the Contact History list. The list has the ID value 2.

local integer nStatus;

{Remove all records for this list.}
nStatus = DeleteForListView(IG_PROD_ID, 2, LIST_PRIMARYVIEWID) of form syListViewOptionsObj;

{Add the default options record for the list.}
nStatus = CreateDefaultViewRecord(IG_PROD_ID, 2, LISTOPTION_ALLRECORDS, DATERESTRICT_LAST90DAYS) of form syListViewOptionsObj;

You can create predefined selections that control what items are displayed in the list. These predefined selections appear in the “Restrictions” group displayed in the Action Pane for the list. Each item has an integer value associated with it, which is used to uniquely identify the options. Typically form-level constants are created for each option. For example, the following constants are defined for the ListObj_ContactHistoryTrx form:

LISTOPTION_CONTACTSSALL: 1

LISTOPTION_CONTACTSACTIVE: 2

 

The items are added by the FillListOptionsDDL procedure each time the list is displayed. The list object state variable for the transaction list is passed into this procedure, which allows access to the content of the drop-down list.

The following is the FillOptionsDDL procedure for the Contact History list. It adds two options to the list. Notice the constants are used to specify the data values for each list item.

inout ListObjState list_object;

{Clear any existing items in the list}
clear field(list_object:ListOptionsDDLRef);

{Add items to the list options}
add item "All Customers", LISTOPTION_CONTACTSALL to field(list_object:ListOptionsDDLRef);
add item "Active Customers", LISTOPTION_CONTACTSACTIVE to field(list_object:ListOptionsDDLRef);


Documentation Feedback