Menu Items Best Practices [AX 2012]
Updated: December 6, 2011
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
Create menu items for runnable application objects for placement in menus and as buttons on forms.
Create the menu item in the appropriate conceptual folder as follows:
-
Display - Must be used for runnable application objects that primarily present forms, dialogs, and so on, to the user.
-
Output - Must be used for runnable application objects whose primarily function is to print a result.
-
Action - Must be used for runnable application objects whose primarily function is to do some kind of a job, such as creating or updating transactions in the database.
The following table describes the best practices for menu item properties, which are in the same order that they appear in the Application Object Tree (AOT).
You must set the NeededAccessLevel property to the appropriate level for every menu item that runs a class. There are no access level settings on individual classes.
Determine the access level required for a class by using the following criteria:
-
Decide what the logical function of the menu item is (the functionality from the users' point of view).
-
Look at all the tables accessed in the class, and find out which is the "highest" access type, and then use it for the required access level:
-
The "highest" access type is Delete.
-
Add is lower.
-
Edit is lower than Add, and so on.
Do not include "service tables," such as SysLastValue, in the analysis.
-
-
A class that is changing a status ("Edit") for several records and is simultaneously creating transactions ("Add") to reflect that change can have the NeededAccessLevel set to Edit because that is the primarily logical function of the class.
Another class that has the same function, where the status change is a logical Delete, can have the NeededAccessLevel set to Delete. This is partially checked by the checkMenuItemActionAccessLevel method in the SysApplCheck class.
Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.
Caution