The Initialize procedure is used to prepare a list to display data. It performs the following:
The following is the Initialize procedure for the Leads list in the sample integrating application.
inout ListObjState list_object; inout string sWindowTitle; inout integer nStatus; default window to State; {Open the Leads list object} nStatus = OKAY; open form ListObj_Leads; if not isopen(form ListObj_Leads) then nStatus = FAILED; abort script; end if; {Set the list type} list_object:ListType = LISTTYPE_CARD; {Set the window title and header title} sWindowTitle = "Leads"; field(list_object:HeaderTextRef) = "Leads"; {Fill the Restrictions drop-down list} call FillListOptionsDDL of form ListObj_Leads, list_object; {Set the initial sort} ColSortOrder = 1; {Register the commands used for the Action Pane} call RegisterCommands of form ListObj_Leads, list_object;
When the user displays another page or list, the Close procedure for the list is run. This procedure must perform any clean-up actions for the list, such as closing the list object form, or removing data from temporary tables used for the list. The following is the Close procedure for the Leads list in the sample integrating application.
inout ListObjState list_object; list_object:IsCreated = false; close form ListObj_Leads;