![]() |
#1 |
Участник
|
Inside Dynamics AX 4.0: RunBase Framework Extension Part III
Источник: http://feeds.feedburner.com/~r/Insid...-part-iii.html
============== Continue from Part II Implementing the run Method You can now write the sendOffers method that contains your business operation as follows. ![]() ![]() ![]() Now is a good time to revisit the pack and unpack methods. Start in the class declaration by setting up the member variables that you want to store. In this example, you store the createServiceOrders variable. State the version number of the current set of member variables. The version number allows you to add new member variables later and still retrieve the old settings from the last execution of the operation. Also, you can specify the version number to be treated as the first version of the member variable list in the #Version1 declaration. This allows you to treat another version as the first version, which you might choose to do if you simply want to ignore a range of older versions. The first version is typically version 1. ![]() The pack method must be changed to follow this specific pattern. ![]() ![]() ![]() Creating a Menu Item To make the operation available from the main menu and the Navigation Pane, you must create a menu item for the operation. The menu item must be attached to a configuration key and a security key. To create a new configuration key, open the AOT and expand Data Dictionary, right-click Configuration Keys, and then select New Configuration Key. Right-click the new configuration key and select Properties to open the property sheet. Change the name to BikeTuningOffers, and add the label number @USR9 to the Label field. The label should read "Bike-tuning offers." If you want to make the configuration dependent on another configuration key, you should fill in the ParentKey property. For this example, make the configuration key dependent on the Quotation configuration key by entering QuotationBasic in the ParentKey property field. The security key property for the menu item should be chosen from the existing security keys. The chosen security key must match the position of the menu item on the main menu or in the Navigation Pane. For example, if you wanted to put your menu item under Accounts Receivable\Periodic, the security key must be CustPeriodic. With the configuration and security keys in place, you are ready to create the menu item. In the AOT, expand Menu Items, right-click Action, and then select New Menu Item. Right-click the new menu item, and then select Properties. Fill out the properties as described in the below table. Bike-Tuning Menu Item Properties ![]() You can drag the class node in the AOT onto the Action node under Menu Items to create a new menu item with the same name as the class and the ObjectType and Object properties already defined. Now add the menu item to the Accounts Receivable submenu. In the AOT, expand Menus, right-click Cust, point to New, and then click Menu Item. Right-click the new menu item, and then select the Properties tab. Change Name to BikeTuningOffers. Change MenuItemType to Action and MenuItemName to BikeTuningOffers. Finally, move the menu item to the Periodic folder of the menu. Save the menu, and then restart the Dynamics AX client to make the new menu item appear in the Navigation Pane and on the Dynamics AX main menu. Adding Property Methods Suppose that you want to run the Bike-Tuning Offers business operation directly from another piece of code without presenting the user with a dialog box. To do so, you must implement property methods according to the property method pattern. This pattern allows you to set and get the properties that would otherwise be inaccessible because member variables in Dynamics AX are protected. Start by writing a parm method for the property as follows. ![]() ![]() Related Articles RunBase Framework Extension Part I RunBase Framework Extension Part II Источник: http://feeds.feedburner.com/~r/Insid...-part-iii.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|