Skip to main content

Posts

Dynamics AX 7 - Searching using BaseX

In a previous post I wrote about the benefit of being file based model store. It allows for quick searching. On top of this the files being xml it allows for using complex searching using XPath and XQuery to find properties. There is a tool out there called basex which is a light weight xml database engine. Allowing for very powerful query and searching. Download it from the site http://basex.org Create a new Database and select the Packages folder. Make sure to tick skip corrupt files as there is 1 file it is not well formatted xml. Take a few minutes Screenshot below gets all the developer documentation on the tables. Another example count the methods and the their name. Big thanks to Peter Villadsen ’s session at the recent tech conference. Mining the Metadata and Authoring X++ Best Practice Rules in Microsoft Dynamics AX I copied his queries from the video to get started (above two screenshots) but I already started experimenting with different things we can get out of...

Where did my list pages go in AX7?

In AX 2012 we had to maintain two forms; a list page and a details form. This has changed in AX7 with the introduction of form patterns. Now we only have to maintain a single form and by applying the correct patterns it is displayed accordingly. This is a big benefit and reduces the overhead of developing and maintaining two forms. Below is an example: Figure 1: Customer list Figure 2: Customer details with the navigation list pulled out Below you see the different patterns. The menu item has a view option which allows you to open the form in the selected view.

Dynamics AX 7–Quick Searching Code

This is quite a helpful tip given to me some time back. Most of the time you want to find a particular piece of code from the whole AOT. In AX7 all the code is file based which means searching can be done much faster with some tools. I have used agentransack but there are other tools out there you could use. http://www.mythicsoft.com/agentransack/download This is handy finding code examples or references in code.

Dynamics AX 7– (Project) Resource management changes

This was an interesting find under the projects module. Now you can put your hours against a Resource rather than a Worker. A resource can be a machine or facility or a worker. I feel this was lacking in prior versions and is a great addition. In prior version you were able to schedule against a resource but the time booked was always against the worker. What this means is now all the Worker references have changed to Resource .  1. Hours forecast and actuals are against a Resource 2. Project/Worker validaiton and Category/Worker validation . If you look at the details of the resrouces you will see that it is linked to a worker but it can now be linked to Vendor/Machine/Tool/Location/Facitlity. From a code perspective if you are upgrading it is fairly straight to port over your code. You should change from Worker to Resource. From if (! ProjValEmplProjSetup::checkWorkerProj(this.Worker, this.ProjId)) To if (! ProjValEmplProjSetup::checkResourceProj(ResourceFac...

Dynamics AX7 Development 6–Adding Delegates for Customised Code in Higher Package

Dynamics AX is split into multiple models the main ones are as follows; Application suite, Application Foundation and Application Platform. If you look at some of the debendencies you see how the organization of model affects the assemblies (how it is compiled). In some cases you have to modify the Foundation or the Platform. The issue with that is you are unable to reference code sitting in a higher package (model). In short a higher model can take dependencies and access elements in a lower model but not the other way around. To get around this limitation you have to use a delegate method. Below is an example of a delegate. The PrintMgmtDocType has a method to get the default report form. See how the delegate method is called from the Foundation and uses an EventHanderResult to pass around the result. The delegate method doesnt have to have any code. It is there to allow other methods to subscribe to it. Now this is the calls in the Suite. Notice how to subscribe by adding...

Dynamics AX7 Development 5–More on extensions (Table extension)

Previous post compared the difference between overlaying and extending. It is clear the benefits of extensions. So to continue that discussion, in this post I will look at extensions by adding a field to a table. Right click on a table you want to extend (ie you want to add a new field). This will create a table extension SalesTable.Extension. See that in the project (right hand side in the Solution Explorer). Open up the table design. You can now drag an EDT or create it by right clicking. The bold items are what have been added to the extension. The greyed items are what is in the base. Thats it. We have added a new field to the table without having to modify the base table.

Dynamics AX7 Development 4–Overlay or extend

In this post I will look at the decision of overlaying or extending. In AX7 you can extend metadata by adding a field to a table or adding a control to a form, and extend business logic by defining event handlers. You can now write event handlers on several pre-defined events on tables, forms, form data sources, form controls, and others. Below we are going to look at a basic example comparing Overlay with Extending (using event handler). As mentioned there are many forms of extensions but for simplicity we will focus on one (event handler). Overlay Overlaying is when you modify existing code by changing the system behaviour. For example lets look at overlaying the initValue method on the CustTable. Right click on the object and click Customize. This will add it to your project. You will see a little [c] to indicate it is a customised object. I added a bit of code to the initValue method. Notice how it has changed colour to indicate it has been customised. Extension (using ev...