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 Lead list. The list has the ID value 1.

local integer nStatus;

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

{Add the default options record for the list.}
nStatus = CreateDefaultViewRecord(IG_PROD_ID, 1, LISTOPTION_ALLRECORDS, DATERESTRICT_NONE) 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_Leads form:

LISTOPTION_LEADSALL: 1

LISTOPTION_LEADSQUALIFIED: 2

 

The items are added by the FillListOptionsDDL procedure each time the list is displayed. The list object state variable for the card 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 Leads 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 Leads", LISTOPTION_LEADSALL to field(list_object:ListOptionsDDLRef);
add item "Qualified Leads", LISTOPTION_LEADSQUALIFIED to field(list_object:ListOptionsDDLRef);


Documentation Feedback