Examples: List_Open

The following example opens the Sales Order Transactions list in a separate window. The code examines whether a transaction list is already open before Sales Order Transactions list is displayed. Notice that the List_Open procedure is called with the background keyword.

local boolean list_is_open;
local string list_name;

{Assume that a list of the specified type is not open.}
list_is_open = false;

if isopen(form syTrxList) then
	if (ListObjState:IsCreated of window TrxList of form syTrxList) then

		{A list is already open. Tell the user which list to close.}
		call GetListPropertiesForListID of form syListObj,
			GetListDictID(ListObjState of window TrxList of form syTrxList)
			of form syListObj, GetListID(ListObjState of window TrxList
			of form syTrxList) of form syListObj, none, list_name;

		{Set the flag indicating the list is open.}
		list_is_open = true;

		{Display a message indicating the situation for the user.}
		warning "You need to close the list: " + list_name;
	end if;
end if; 

if list_is_open = false then
	call background List_Open of form syListObj, DYNAMICS, LISTID_SOPTRX, LIST_PRIMARYVIEWID, none, none, none, true;
end if;

Documentation Feedback