Skip to main content

How to add new menu item under Actions menu in Epicor

To create a new menu item in the action item you can use the below code. 

Add the below code in the Form_Load

//create a new button tool for UltraWinToolbars
 Infragistics.Win.UltraWinToolbars.ButtonTool NewTool = new         Infragistics.Win.UltraWinToolbars.ButtonTool("NewItem");
// set the Properties of the new menu
       NewTool.SharedProps.Caption = " New Item ";
       NewTool.SharedProps.Enabled = true;
       NewTool.SharedProps.Visible = true;
       NewTool.SharedProps.AppearancesSmall.Appearance.Image = System.Drawing.Bitmap.FromHicon(SystemIcons.Application.Handle);
       baseToolbarsManager.Tools.Add(NewTool);

// add the new created button tool to Action Menu
((Infragistics.Win.UltraWinToolbars.PopupMenuTool)baseToolbarsManager.Tools["ActionsMenu"]).Tools.Add(NewTool);

// create the Tool clik method of your created tool
       NewTool.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(NewTool_ToolClick);

      
Then add the following event handler in the code editor 

   private void NewTool_ToolClick(object sender,Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
    {
      // Add your action Here
    }

Comments

  1. That was working fine thanks.

    But what about toolbars added to a dashboard ?

    I added a new sheet linked to a dashboard, and selected the option to see the tools menu. I would like to add my own tool icon to click in order to perform some actions related to the dashboard results...on user demand...and not on dashboard update, because it takes a long time to view....

    So Is it possible to add my own image button on that toolbar?

    Also, that DB has a tracker panel. during design, I noticed I was able to go into customization, and was able to add a button. But at run time, the button was not visible....Am I missing something? Or this is normal?....

    Thansk

    ReplyDelete
    Replies
    1. Actually, you can add items to the menu in the dashboard as action items and then you will write BPM in your BAQ itself to and I will record a video for that soon.

      Delete
  2. Waleed
    Thanks for this post and all the others you have offered to the community. I do have an add on question however. Adding the item on the action menu worked GREAT. How would we add a sub menu under the action menu so it would be action->new sub menu->new menu button 1. Thanks for any insight you can offer.

    ReplyDelete
    Replies
    1. Thanks for your nice words.

      You can add a sub menu under actions menu as below:

      // Create a PopupMenuTool.
      PopupMenuTool subMenu = new PopupMenuTool("SubMenu");

      // Set some properties on the Popup menu (Optional)
      subMenu.AllowTearaway = true;
      subMenu.SharedProps.Caption = "Sub Menu 1";

      // Always add new tools to the UltraToolbarManager's root tools collection
      // before adding them to menus or toolbars.
      baseToolbarsManager.Tools.Add(subMenu);

      //Add the popup menu to "ActionsMenu"
      ((PopupMenuTool)baseToolbarsManager.Tools["ActionsMenu"]).Tools.AddTool("SubMenu");

      // Create a button Tool
      ButtonTool button = new ButtonTool("button");
      //Set the properties
      button.SharedProps.Caption = "button";
      button.SharedProps.Enabled = true;
      button.SharedProps.Visible = true;

      // Always add new tools to the UltraToolbarManager's root tools collection
      // before adding them to menus or toolbars.
      this.baseToolbarsManager.Tools.Add(button);

      //Add the button tool to the sub menu named ""
      subMenu.Tools.Add(button);

      Hope this will help you.

      Delete
  3. Really Nice.....
    That was working fine thanks.

    ReplyDelete
  4. Hi Waleed,

    we use Vantage 8. Can you help me out with the following question.
    In the sub menu under the actions menu (In AR Invoice entry > Action > Group) there are four different options.
    But all of them have the same image. The images are little squares with a tiny egg-timer below the left corner.
    I can't remember the image name now but maybe you know it.
    One of the four options is Print Invoices. Do you know how I can disable that option through vb net code?
    I know how to disable an item directly under the Action menu,
    but not if it's under the sub menu and I can't find the tool's name as a being a member of the baseToolbarsmanager.
    And if I could find it I think I can't disable the item because all four options would be disabled because all of them have the same tool image.

    Any help would be very appreciated,

    Regards,

    Pokey!

    ReplyDelete
  5. Thanks for valuable hint.

    Can you expand this further with an example?

    Assume am on sales order. And i want to print sales order with custom BAQ report.

    How will i print that opened order with action menu print option?

    Am not guru in coding. Am learning and in my company we have epicor.

    Your example will be very valuable.

    Regards

    ReplyDelete
  6. Thank a lot .It's helpful for me.

    ReplyDelete
  7. Hi ,

    Thanks for the post,is it possible to hide performa invoice from action menu in SO entry.how can we know the key id.

    Thanks

    ReplyDelete
  8. Hi,

    I am not able to set icon on button tool? what could be the reason?
    I tried two ways:

    First:
    NewTool.SharedProps.AppearancesSmall.Appearance.Image = System.Drawing.Bitmap.FromHicon(SystemIcons.Application.Handle);

    Second:
    NewTool.SharedProps.AppearancesSmall.Appearance.Image =
    EpiUIImages.SmallEnabledImages.Images[EpiUIImages.IndexOf("Print")];

    ReplyDelete
  9. Hello Waleed,

    I am trying to hide one of the menu items from the menu,
    baseToolbarsManager.Tools["ItemTool"].SharedProps.Visible = false; works great for the top menu.

    But how do I remove it from the Right-Click list of menu items when the user rightclicks on a grey area of the form. ?

    thanks

    Pierre

    ReplyDelete
  10. @Index InfoTech and future googlers that stumble across this post, you'll need a "using System.Drawing to access "System.Drawing.Bitmap.FromHicon(SystemIcons.Application.Handle)". I haven't been able to manage EpiUIImages in E10.

    ReplyDelete
  11. @IndexInfoTech and future googlers of this post, add "using System.Drawing;" to access "System.Drawing.Bitmap.FromHicon(SystemIcons.Application.Handle);"

    I haven't managed to grab EpiUIImages yet from E10.

    ReplyDelete

Post a Comment

Popular posts from this blog

Epicor 9 ToolBars

Like any other application, Epicor has list of toolbars and it uses the Infragistics controls and you can modify these toolbars in your code by adding new tools or change the properties for the existing toolbars and Tools.

How to Use the Business Activity Query Export Process

Business Activity Query Export Process let you export the BAQ data in XML or CSV format. You can export the BAQ data manually and you can schedule it to run automatically (Daily, Weekly, ,Monthly,Once,startup..etc) and you can configure this in the “system agent maintenance” and I will explain this later in this article.