Well, I have created a similar Add-In for classes. The goal of that Add-In is the same as the find(..) & exists(..) Add-In, to speed up code implementation.
What's the functionality?
- It creates required abstract and interface methods
- If the class is not abstract, a protected new(..) and a static construct(..) constructor will be created
- If the class is in the RunBase tree, a static main(..) method is created
- Already created methods will not be touched
How to install:
- Import this XPO containing a private project with a class and a menu item.
- Add the menu Item to the menu SysContextMenu (you can decide on what position)
- Add a the code below to the class method SysContextMenu/verifyItem before line 217 (switch menuItem)
case menuItemActionStr(DEV_CreateDefClsMeths):
return ! docNode && _firstType == UtilElementType::Class; - In AOT, select a class and open context menu/Add-Ins. You will see now the new entry named Create default class methods. Klick it to process.
It works in AX 2009. Not tested for AX 4.0
(this article is available in English only)
He,
ReplyDeleteI have to follow this procedure but it doesn't work in AX2009 SP1 ?
I cannot to see the menu item in the Add-Ins menu.
It is very strange :s
Hi 'Developer'
ReplyDeleteCheck the follow conditions:
- is the menu item really present in SysContextMenu?
- is the first item selected in AOT a class node?
You can try to remove the modification in class method SysContextMenu.verifyItem(). After that, the context menu entry should be shown for every AOT node.
If this helps not, please let me know!
The muenu item code is added in the SysContextMenu class but it is not visible in the menu.
ReplyDeleteThe first item selected in AOT is offcourse a class node. I have to place the modification in the first case of the menuitem-action switch but it doesn't help :(
The SysContextMenu.verifyItem() modification is optional. But I guess, you have not added the MENUITEM to the AOT\MENUS\SysContextMenu and therefore you cannot see the menu.
ReplyDeletePlease check the
AOT\Menus\SysContextMenu menu.
By the way: if it does not work again - I can send you a step by step document. Send me a message at patrick[AT]luegisdorf.ch
Till later
Hi Patrick,
ReplyDeleteIt works now :) I have a mistake, I forget to add the menu item in the SysContextMenu. It's very shamefull for my.
I thanks you for your help. Very great ;)
Greetings