Menu creation procedure

To create the menus for your integrating application, you need to write a procedure that defines the default set of menu items. This procedure will run in response to a procedure trigger you will add for the CreateDefaultMenuStructure procedure in Microsoft Dynamics GP.

Registering the menu creation trigger

The following example shows the registration in the sample integrating application for the trigger that runs in response to the CreateDefaultMenuStructure procedure in Microsoft Dynamics GP. When the trigger is activated, the IG_CreateMenuItems procedure is run.

l_result = Trigger_RegisterProcedure(script CreateDefaultMenuStructure, TRIGGER_AFTER_ORIGINAL, script IG_CreateMenuItems);
if l_result <> SY_NOERR then
	warning "Procedure trigger registration failed.";
end if;

Parameters

Your integration will have one procedure that will create the default set of menu items for the integration. This procedure will run in response to the trigger registered for the CreateDefaultMenuStructure procedure.

The menu creation procedure has two parameters:

in integer LoadMode;
optional in boolean ShowProgress;

The LoadMode parameter indicates what action the menu creation procedure will be performing, based on the value passed in through the parameter. It will correspond to one of the following constants:

[spacer]

Constant

Description

MENULOAD_TOTABLE

The menu items are being added to the default menu set in the syMenuMstr table.

MENULOAD_TOMEMORY

The menu items are being added directly to the menu set displayed in Microsoft Dynamics GP.


The ShowProgress parameter is not used.

Execution

The menu creation procedure for your integration will run once when the user logs into Microsoft Dynamics GP. The LoadMode parameter will correspond to the MENULOAD_TOTABLE constant, indicating that the menu creation procedure should examine the default menu items for the integration. If they do not exist, the menu creation procedure should add them to the default menu set.

If the user has not customized their menu set, the menu creation procedure will be run again. The LoadMode parameter will correspond to the MENULOAD_TOMEMORY constant, indicating that the menu creation procedure should add its default menu items directly to the menu structure in Microsoft Dynamics GP.


Documentation Feedback