Right-Click Context Menu in D365O on a Tree control

AX 2012 used the PopupMenu class to create a right-click context menu. In D3650, Microsoft has done away with that and introduced the ContextMenu API which can be used to do the same thing.

You can override the form control methods and use the getContextMenuOptions to create context menu options and override the selectedMenuOption method to select the menu options.

Demo: AOTName - CostSheetDesigner form

CostsheetDesignerCtrl is a class that helps to creates the context menu options "Cut", "Copy" and "Paste" in the createContextMenu and allows selection in selectContextMenuOption methods.

Override form control method








To create menu options in the CostsheetDesignerCtrl class


















Now for the selection:
Override form control method







Calls this method in the CostSheetDesignerCtrl class












And the Right-click context menu in the form with the "Cut" and "Copy" options:

Comments

  1. Hi, thanks for helpful post,
    i'm asking how to add icons to Tree Control ?

    ReplyDelete

Post a Comment

Popular posts from this blog

Override a System Defined Refresh button in D365O

Printing PDF Attachments in MSDyn365FO