Professional Documents
Culture Documents
Epicor Customizations - Add Action Menu Entries - GingerHelp
Epicor Customizations - Add Action Menu Entries - GingerHelp
support@gingerhelp.com
E P I C O R C U STO M I Z AT I O N S :
A D D I N G YO U R OW N
AC T I O N S M E N U E N T R I E S
ADAM ELLIS · OCTOBER 18, 2019
L E T ' S C H AT A B O U T YO U R E P I C O R C U STO M I Z AT I O N
R E Q U I R E M E N TS
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-your-own-actions-menu-entries 1/10
4/25/23, 12:04 PM Epicor Customizations: Add Action Menu Entries — GingerHelp
The first 3 lines are all you need to edit should you reuse this snippet in
your project. In the first line, we are giving this new menu entry a name -
in our case “CopyPriceList.” Typical object naming rules here, no spaces
or special characters, and make it something logical. Next, we define the
label this menu entry shows up with, in our case, “Copy Price List.” Lastly,
we have the new menu index - for this one, you want to look at the
existing menu and determine the index of where you want your new
menu entry to show up (starting your counting at 0). So for myself, I
wanted my new entry to come right after ‘Export,’ which is at index 1,
hence my selection of 2 for the new index. The menu entry currently at
index 2 (Attachments) is bumped to position 3 when our new menu entry
is added.
The remaining lines of code are going to be boilerplate, but you can see
what they do - a new ButtonTool object is created, a caption is applied to
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-your-own-actions-menu-entries 2/10
4/25/23, 12:04 PM Epicor Customizations: Add Action Menu Entries — GingerHelp
it, a test runs to see if the button already exists and, if not, it is added and
assigned to the Actions menu.
And then within that generated code block test for the condition that our
menu entry was clicked:
default:
break;
}
}
If you haven’t used this ToolClick form event handler before, note that ALL
button/menu click events show up in here, and that is why we do a test
on args.Tool.Key to make sure we are only looking for a specific button or
menu item.
So one last bit to button this up - in many Epicor screens, you would see a
menu action like this only be enabled if it were relevant. So in the
example case here, I would only want to see the copy price list option be
made available if I had a price list loaded up on the screen. The ‘Enabled’
shared property on ButtonTool can help us to accomplish this. To set this
up first you will need to define that ButtonTool at the script level as
opposed to within InitializeCustomCode:
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-your-own-actions-menu-entries 4/10
4/25/23, 12:04 PM Epicor Customizations: Add Action Menu Entries — GingerHelp
int newButtonIndex = 2;
Now add an EpiViewNotification for the data that will drive whether this
menu item should be enabled or disabled:
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-your-own-actions-menu-entries 5/10
4/25/23, 12:04 PM Epicor Customizations: Add Action Menu Entries — GingerHelp
And then within that code stub Epicor puts in for us use that ‘Enabled’
shared property as you see fit - for me I am just enabling it so long as
there is a PriceLst row present:
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-your-own-actions-menu-entries 6/10
4/25/23, 12:04 PM Epicor Customizations: Add Action Menu Entries — GingerHelp
using Infragistics.Win.UltraWinToolbars;
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-your-own-actions-menu-entries 7/10
4/25/23, 12:04 PM Epicor Customizations: Add Action Menu Entries — GingerHelp
It gives me an error:
The type or namespace name 'ButtonTool' could not be found (are you missing a
using directive or an assembly reference?)
PREVIOUS
NEXT
LET’S CHAT!
CONTACT US
SERVICES PRODUCTS
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-your-own-actions-menu-entries 8/10
4/25/23, 12:04 PM Epicor Customizations: Add Action Menu Entries — GingerHelp
GingerHelp is an
independent consulting
practice with no direct
© 2019 - 2023 GingerHelp,
affiliation with Epicor® or
LLC
Infor®.
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-your-own-actions-menu-entries 10/10