Change AOT objects without AX client

During the #MSDyn365FO upgrade code cleanup exercise for Best Practice errors one of our forms got corrupted. Compilation has caused a crash, and when I tried to reopen it then it went in an endless compile loop. I had to find a way to change AOT objects without AX client.

This could be achieved by various different solutions. One option is using the SysStartupCmd framework to import a corrected XPO with the AOTimportFile startup command. Also you could try removing the objects from the ModelElement and ModelElementData tables within the AX2012_model ModelStore DB. Another solution is to go around using the client.

I went with the last option, and used a client-less approach via talking directly to the Application Object Server through the Business Connector interface. Here is a simple PowerShell script I have implemented that uses reflection for the AOT elements, where I could access a SysTreeNode object and then delete it:

Change AOT objects without AX client using Business Connector in PowerShell

This is how you could change AOT objects without AX client in a fast, safe and easy way. BC is still a very powerful way of running code on-the-fly. A similar approach was applied when we wanted to validate if AIF ports were up and running on our AOS instances earlier.

https://www.daxrunbase.com/2016/08/17/validate-aif-ports-running-ax/

DAXRunBase / 2018-09-11 / AX 2012 / 0 Comments

Validate AIF ports if they are running in AX

It may happen that AIF ports are failing due to an error, or they do not activate when the AX AOS instance gets started. There is a way to validate AIF ports if they are running correctly using a combination of X++ code and a PowerShell script that you may find below.

Add the following to the Global class collection and do a Full CIL:

And here is the PowerShell script to validate AIF ports. Please make sure you provide a comma-separated list for the AOS names, and a correct path where the Business Connector DLL could be found. Also you might want to provide credential details for the AX login if the user running the script does not have access.

validate AIF ports

 

DAXRunBase / 2016-08-17 / AX 2012 / 2 Comments

PowerShell and AXModel files

In AX 2012 there is a very high chance that you have to work with the new AXModel files.

You may receive an ISV solution, or a Microsoft hotfix and you would like to know what is inside. If you have installed the management extensions, you can go to Start menu > Administrative tools > Microsoft Dynamics AX 2012 Management Shell to open PowerShell to access the AX-specific utilities.

We have a hotfix in our example, and would like to see what objects are inside, which may cause a conflict with out customizations. You can run the following command to get more details from our AXModel hotfix:

(more…)

DAXRunBase / 2012-10-09 / AX 2012 / 0 Comments

DAXRunBase 2012

Hi Friends!

Since Microsoft Dynamics AX 2012 is now booming, it is time to share some interesting features, problems and solutions for this exciting new product which is already out in the wild on the DAXRunBase blog.

In future posts I am planning to cover ways of using the Team Foundation Server and build automation, show tricks that can make everyday development a bliss, introduce using PowerShell and AxUtil during your everyday life and a lot more.

I really hope you will find the following posts useful, and a thumbsup in comments always helps to keep me motivated =)

Cheers
Vilmos Kintera

DAXRunBase / 2012-08-13 / Microsoft Dynamics AX / 0 Comments