The filtering feature of the transaction list allows the user to create restrictions that display specific rows in the list. Most fields in the list can be searched without any additional coding required for the list. However, some fields (such as list boxes, drop-down lists, visual switches, and radio groups) require additional coding to define the tokens that can be used for filtering based on these fields.
The filter tokens provide a user-friendly representation of the data for that field, making it easy to select the possible values for that field when defining a filter. For example, the Contact History transaction list has a column for the Last Contact date. This column is a date value and has several filter tokens that are automatically created for it.
The core list code can automatically produce filter tokens for many list fields. For the other fields that require filter tokens (typically list fields), you will add code to the GetColumnTokens procedure you define for your list. This procedure has the following parameters:
in ListObjState list_object; in ColFieldID nFieldID; in ColArrayIndex nArrayIndex; in long nColumnID;
The GetColumnTokens procedure is called automatically when each column is added to the list. The parameters for the procedure indicate which column is being added. You will use the Columns_AutoGenTokensForEnumField() function function defined for the syListObj form to define the tokens for the field. In certain special cases, you will need to use the Columns_AddToken() function to create the filter tokens. Refer to the description of that function for details.
The following example is the GetColumnTokens procedure for the Contract History transaction list. It defines the filter tokens for the Active column, which is based on a check box.
in ListObjState list_object; in ColFieldID nFieldID; in ColArrayIndex nArrayIndex; in long nColumnID; local long internal_ID; if nFieldID = resourceid(field 'Inactive') then {Need to add tokens for this check box field} {Active} internal_ID = Columns_AddToken(list_object, nColumnID, "Yes", {Token name} 1, {Unique ID for this token} "(ACTIVE = '1')") of form syListObj; {Inactive} internal_ID = Columns_AddToken(list_object, nColumnID, "No", {Token name} 2, {Unique ID for this token} "(ACTIVE = '0')") of form syListObj; end if;