List navigation

A list window is actually opened using a command that you define. Commands to open lists must have the type DataList, and specify the form that provides the base functionality for the list.

The command that opens the Contact History list in the sample integrating application has the following characteristics:

Command Name: ListObj_ContactHistory

Display Name: Contact History

Type: Data List

Data List Form: syListObj

Image Type: Icon

Normal Image: ListPage

 

A separate procedure in Microsoft Dynamics GP is used to create the items that appear in each section of the Navigation Pane. The following table lists the procedures used for each:

[spacer]

Navigation Pane section

Procedure

Administration

CreateMenu_Administration_NavButton

Field Service

CreateMenu_FieldService_NavButton

Financial

CreateMenu_Financial_NavButton

HR & Payroll

CreateMenu_Payroll_NavButton

Inventory

CreateMenu_Inventory_NavButton

Manufacturing

CreateMenu_Manufacturing_NavButton

Project

CreateMenu_ProjectAccounting_NavButton

Purchasing

CreateMenu_Purchasing_NavButton

Sales

CreateMenu_Sales_NavButton


A procedure trigger registered for one of these procedures is used to add the list command to the appropriate location in the Navigation Pane menu structure. For example, the following is the procedure trigger registration that adds the Navigation Pane items for the sample integrating application.

l_result = Trigger_RegisterProcedure(script CreateMenu_Sales_NavButton, TRIGGER_AFTER_ORIGINAL, script IG_CreateNavBarItems);
if l_result <> SY_NOERR then
	warning "Procedure trigger for CreateMenu_Sales_NavButton failed.";
end if;

The trigger processing procedure has the following parameters, which indicate the command list to which commands should be added:

in CmdParentDictID ParentDictID;
in CmdParentFormID ParentFormID;
in CmdParentCmdID ParentCmdID;
in integer LoadMode;

The following is the trigger processing procedure that adds the ListObj_ContactHistory command to the Sales section of the Navigation Pane:

in CmdParentDictID ParentDictID;
in CmdParentFormID ParentFormID;
in CmdParentCmdID ParentCmdID;
in integer LoadMode;

local integer Seq;
local integer Status;

{Add the Contact History command to access the Contact History list}
{Find the appropriate location to add the item, after Salespeople}
Seq = FindCommandInMenu(ParentDictID,
	ParentFormID, 
	ParentCmdID,
	DYNAMICS,
	resourceid(form Command_Sales),
	resourceid(command ListObj_Salespeople of form Command_Sales),
	LoadMode,
	"");

{If the item was found, add the new item after it.}
if Seq <> 0 then
	Seq = Seq + 1;
end if;

{Add the Contact History command to access the Contact History list}
Seq = Seq + 1;
Status = AddCommandToMenu(ParentDictID,
	ParentFormID, 
	ParentCmdID,
	Seq,
	IG_PROD_ID,
	resourceid(form Command_IG_Sample),
	resourceid(command ListObj_ContactHistory of form Command_IG_Sample),
	true,
	LoadMode);

The final step to making the list accessible is registering it. This is typically performed in the form pre script for the command form that defines the list navigation command. The registration process does the following:

 

The RegisterListNavigationCommand() function registers the command that will open the list. The following example is the form pre script for the Command_IG_Sample form defined in the sample integrating application. It registers the navigation command that opens the Contact History list. The Contact History list is assigned the ID value “2”.

Consider creating a constant for the list ID value. For instance, the constant LISTID_CONTACTHISTORY is used for the Contact History list in the sample integrating application.


local boolean result;

result = RegisterListNavigationCommand(command ListObj_ContactHistory,
		IG_PROD_ID,
		2,
		IG_PROD_ID,
		resourceid(form ListObj_ContactHistoryTrx),
		0,
		LISTTYPE_TRX,
		command SalesButton of form Command_NavBar) of form syListObj;


Documentation Feedback