Posts

Showing posts from May, 2007

Add menu items to the context menu in Dynamics

Image
You can add your own menu items to the Context menu in Dynamics by adding a reference of the menu item to the SysContextMenu menu. As seen in the image, I have added a class menu item ShowFormMethods to the sysContextMenu. After I save, I right click on any node in AOT and goto Add-ins, I can see my menu item. You can also add a menu item to Tools -> Development Tools by adding a reference of the menu item to DevelopmentTools menu. I have added a small project which you can look into and see how it has been done. Download it here .

Handling events of runtime form controls

Sometimes you may have to create a form during run time. That can be easily done by creating an object of the Form class. You can also create objects of different controls and add. But what if you want to handle events of these controls? For this you have to tell the form system where to look for events. This can be done by calling the controlMethodOverload on the formRun with a true value. This makes the form look for methods on the formRun object. But we cannot add methods on the formRun object because it is created during runtime. So you can tell the form which object to look for the methods by providing the object to the controlMethodOverloadObject method. Method’s name must have the following naming convention and it must be strictly followed, _ ex, MyButton_clicked Create a class like given below, class RunTimeFormClass { } Add a method createForm to it like this void createForm() { FormBuildDesign formBuildDesign; FormButtonControl myButton; FormRun formRun; Form form; Args

Export data of selected tables only...

Sometimes when you want to share data in your tables with other, you export it from Administration -> Periodic -> Data export/import -> Export to . But this exports data in all your tables. What if you want to export data from selected tables only? Here is how you can do that. First create a definition group from Administration -> Periodic -> Data export/import -> Definitions group In the definition group form, create a new group. Name it XYZ. Click on Table setup button. By default, the table setup form has all the tables listed, select and delete all of them. Now add only the tables you want data to be exported for. Now click on Administration -> Periodic -> Data export/import -> Export to In the definition group, specify the group we created above and click OK In this way, you can export data for selected tables only.