Menu focus triggers

You can create triggers for items in form-based menus. The menu items, not menus themselves, respond to a change focus event only. The value of the focus_type parameter indicates which menu item activates the trigger. For instance, if you set focus_type to 2, the second menu item in the menu activates the trigger.

Microsoft Dynamics GP uses command-based menus. You can’t use menu triggers with command-based menus. For Microsoft Dynamics GP, you can only use menu triggers for form-based menus.


Example 9: Menu focus trigger

This trigger is activated when the user chooses Quick Print from the Options menu available when the Sales Transaction Entry window is displayed. The Options menu is part of the SOP_Entry form, and the Quick Print menu item appears as the sixth item in the submenu.

{Name: Startup}
local integer l_result;

l_result = Trigger_RegisterFocus(anonymous(menu 'Options' of form 'SOP_Entry'), 6, TRIGGER_AFTER_ORIGINAL, script IG_TrackQuickPrint);


Documentation Feedback