List columns

The CreateListColumnsData procedure for the list form specifies which columns will be available for the list window. The CreateDefaultColumn() funtion is used to add columns to a card list. When you add columns, you specify the following:

 

The following is a portion of the CreateListColumnsData procedure that defines the columns for the Leads list. Note that the order the columns are defined in this script specifies the default order they will have in the list, because the sequence number is incremented for each additional column.

in ListDictID nListDictID;
in ListID nListID;

local integer nStatus;
local integer nSeq;
local integer nRet;
local integer PRODUCT_ID;

{Set the product ID}
PRODUCT_ID = IG_PROD_ID;

{Delete any existing column information for the list}
nRet = DeleteForListView(nListDictID, nListID, LIST_PRIMARYVIEWID) of form syListViewColObj;
nSeq = 0;

{--- Marked To Process checkbox ---}
increment nSeq;
nStatus = CreateDefaultColumn(
	nListDictID,
	nListID,
	nSeq,
	resourceid(field 'Marked To Process'){field id},
	COLSORTORDER_NONE {sort order},
	true {visible},
	25 {width},
	0, {array index}
	0, 0, {no format field }
	0, {token ID}
	0 {sort seq}) of form syListViewColObj;


{--- Information Icon ---}
increment nSeq;
nStatus = CreateDefaultColumn(
	nListDictID,
	nListID,
	nSeq,
	resourceid(field InfoValue){field id},
	COLSORTORDER_NONE{sort order},
	true{visible},
	25{width},
	0,
	0, 0, { no format field }
	0, {token ID}
	0{sort seq}) of form syListViewColObj;


{--- Lead Name ---}
increment nSeq;
nStatus = CreateDefaultColumn(
	nListDictID,
	nListID,
	nSeq,
	resourceid(field 'Lead Name'){field id},
	COLSORTORDER_ASCENDING{sort order},
	true{visible},
	180{width},
	0,
	0, 0, { no format field }
	0, {token ID}
	0{sort seq}) of form syListViewColObj;


{--- Lead ID ---}
increment nSeq;
nStatus = CreateDefaultColumn(
	nListDictID,
	nListID,
	nSeq,
	resourceid(field 'Lead ID'),
	COLSORTORDER_NONE{sort order},
	true{visible},
	80{width},
	0,
	0, 0, { no format field }
	0, {token ID}
	0{sort seq}) of form syListViewColObj;

The column data for your list is stored in the sy07226 table in the DYNAMICS database. As you create your list, you may need to reset the default columns that appear for the list. To do this, you will need to delete the appropriate rows for your list from the sy07226 table.

Notice that the column display names are not part of the column definitions created in the CreateListColumnsData procedure. The column names are used in various locations in the list implementation, so they are defined in a separate procedure named GetColumnName.

This procedure typically contains a case statement that returns the appropriate column name, based on the resource ID passed into the procedure. The following is the GetColumnName procedure for the Leads list in the sample integrating application.

in ColFieldID sFieldID;
in ColArrayIndex iColIndex;
out string sColName;

default window to State;

case sFieldID 
	in [resourceid('Lead ID' of table IG_Leads_MSTR)]
		set sColName to "Lead ID";
	in [resourceid('Lead Name' of table IG_Leads_MSTR)]
		set sColName to "Lead Name";
	in [resourceid('Address 1' of table IG_Leads_MSTR)]
		set sColName to "Address 1";
	in [resourceid('Address 2' of table IG_Leads_MSTR)]
		set sColName to "Address 2";
	in [resourceid('City' of table IG_Leads_MSTR)]
		set sColName to "City";
	in [resourceid('State' of table IG_Leads_MSTR)]
		set sColName to "State";
	in [resourceid('Zip' of table IG_Leads_MSTR)]
		set sColName to "ZIP";
	in [resourceid('Contact' of table IG_Leads_MSTR)]
		set sColName to "Contact";
	in [resourceid('Lead Business Category' of table IG_Leads_MSTR)]
		set sColName to "Category";
	in [resourceid('Potential Revenue' of table IG_Leads_MSTR)]
		set sColName to "Potential Revenue";
	in [resourceid('Phone 1' of table IG_Leads_MSTR)]
		set sColName to "Phone 1";
	in [resourceid('Phone 2' of table IG_Leads_MSTR)]
		set sColName to "Phone 2";
	in [resourceid('Fax' of table IG_Leads_MSTR)]
		set sColName to "Fax";
	in [resourceid('Qualified Lead' of table IG_Leads_MSTR)]
		set sColName to "Qualified";
	in [resourceid('Qualification Date' of table IG_Leads_MSTR)]
		set sColName to "Qualification Date";
	in [resourceid('Lead Source' of table IG_Leads_MSTR)]
		set sColName to "Source";
	else
		set sColName to "<<No Name>>";
end case;


Documentation Feedback