Filter tokens

The filtering feature of the card 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 Leads card list has a column for the Lead Business Category. This column is a drop-down list that stores integer values 1 through 8, representing the category. Rather than requiring the user need to know which category corresponds to which value, filter tokens are created for this field to display the category values.

[spacer]

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 Leads card list. It defines the filter tokens for the Lead Business Category column, which is based on a drop-down list.

in ListObjState list_object;
in ColFieldID nFieldID;
in ColArrayIndex nArrayIndex;
in long nColumnID;

local boolean status;

if nFieldID = resourceid(field 'Lead Business Category') then
	{Can use the auto-generated tokens}
	status = Columns_AutoGenTokensForEnumField(list_object, 'Lead Business Category' of window State, nColumnID) of form syListObj;
end if;


Documentation Feedback