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 Contact History 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; nRet = DeleteForListView(nListDictID, nListID, LIST_PRIMARYVIEWID, "") of form syListViewColObj; nSeq = 0; {--- checkbox ---} increment nSeq; nStatus = CreateDefaultColumn( nListDictID, nListID, nSeq, resourceid(field 'Marked To Process'){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; {--- 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; {--- Customer Number ---} increment nSeq; nStatus = CreateDefaultColumn( nListDictID, nListID, nSeq, resourceid(field 'Customer Number'){field id}, COLSORTORDER_ASCENDING{sort order}, true{visible}, 100{width}, 0, 0, 0, { no format field } 0, {token ID} 0{sort seq}) of form syListViewColObj; {--- Customer Name ---} increment nSeq; nStatus = CreateDefaultColumn( nListDictID, nListID, nSeq, resourceid(field 'Customer Name'){field id}, COLSORTORDER_NONE{sort order}, true{visible}, 150{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 Contact History list in the sample integrating application.
in ColFieldID sFieldID; in ColArrayIndex iColIndex; out string sColName; default window to State; case sFieldID in [resourceid('Customer Number' of table ContactHistoryTrxTemp)] set sColName to "Customer ID"; in [resourceid('Customer Name' of table ContactHistoryTrxTemp)] set sColName to "Customer Name"; in [resourceid('First Contact Date' of table ContactHistoryTrxTemp)] set sColName to "First Contact"; in [resourceid('Last Contact Date' of table ContactHistoryTrxTemp)] set sColName to "Last Contact"; in [resourceid('Contact Salesperson ID' of table ContactHistoryTrxTemp)] set sColName to "First Contact Salesperson"; in [resourceid('Contact Salesperson ID 2' of table ContactHistoryTrxTemp)] set sColName to "Last Contact Salesperson"; in [resourceid('Active' of table ContactHistoryTrxTemp)] set sColName to "Active"; else set sColName to "<<No Name>>"; end case;