Tuesday, September 25, 2012

Deploying AX 2012 Code : Spotlight


Hi There!
I hope everyone is having a good week. In this post I would like to do a spotlight of Dynamics AX Musings on deploying out code in AX 2012.
Joris brings to our attention the importance of focusing on models instead of XPO's when we want to move code to different instances of AX. In addition, he does a good job explaining the issues that we will experience when using XPO to migrate code instead of using models, and in what form code should really be handled in AX 201 when it comes to deployment.
Joris also points out ways to avoid downtime in a production environment by giving examples from his own experience and by doing an analysis of the white paper Deploying Customizations Across Microsoft Dynamics AX 2012 Environments.

From the post:

"I made this statement to one of our clients a few months ago, and I'd like to share it with you: moving XPOs is barbaric. Yes, barbaric. As AX developers, administrators, implementers and customers we need to move on.

Yes, moving XPOs has some benefits, but they are all benefits to circumvent proper procedure. The benefit of moving one piece of code? That's introducing risk and circumventing proper code release management (branching and merging for the version control aficionados).

The benefit of no downtime? That is bad practice, what about users that have cached versions of your code running in their sessions? Not to mention data dictionary changes. The benefit of not having to recompile the whole code base? Talk about bad practice again, and all the possible issues that come out of that. Sure, you say, but I am smart and I know what I can move without risk"
You can access this post from here.

That's all for now folks!


Wednesday, September 19, 2012

Microsoft Dynamics Events - Microsoft Dynanmics World

Hi there!

I got an email from Microsoft Dynamics World with a bunch of very interesting web casts. 

Topics vary from AP automation and Inventory management to Business Intelligence and CRM.

You can access this from here.

 That's all for now folks.

Friday, September 14, 2012

Delete User Layer with AX 2012 Management Shell


Hi there,

I hope you are ready for a great weekend. I will have to work, but this is why we love what we do, and believe that our customers should get the best of us.

Anyway, this is going to be a short post about how to delete a user layer from the model store in AX 2012. I have to say that I miss the flexibility of AX 2009 when it comes to application files and layers. The good news is that for the Microsoft Dynamics AX R2 release, we are supposed to have the code in a different database.

Ok, so going back to our topic, to delete a user layer from the model you first need to install the Management Tools from your AX 2012 setup. Once this is done, you can access the Microsoft Dynamics AX Management Shell and write the following script:

axutil delete /layer:Usr

See the picture below for more details:


As you can see, deleting a layer is not difficult at all and it happens fairly quick too. Also, it is very important that you have a backup of the database before performing this action.

That's all for now folks.

Tuesday, September 11, 2012

Unable to construct an object from the class in the batch framework -


Hi There!

I hope your week is going ok and with lots of challenges.

As we all know, when we want to run a custom class in the server as a batch job we need to extend the RunBaseBatch class and schedule a job for it.

Today I was working on a class that needed to be run in the server in AX 2012. However, before I scheduled the process, I made the choice to test my class from the client to make sure I did not have any bugs. When the test was successful, I scheduled the job and waited for the batch job status to go from Waiting to Ended, and to my surprise I got an error.

I wasn't sure if I did have another bug in my class that I did not catch, so I just copied the sample batch class Microsoft has here and schedule another job to see if the problem indeed in my code. I got the same error:

"Unable to construct an object from the class Sample Class in the batch framework. Make sure that the X++ code has been compiled to Microsoft .NET Framework CIL, and that the constructor does not require any parameters"

Looking at some documentation, I read that in some cases we need to generate a full CIL compile, but this takes forever. Then a good friend of mine mentioned that a an Incremental CIL will most likely fix the error, an it did.

So, just to be thorough I would like to show the steps on how to do this:

Open a new development environment and click Build and then choose Generate Incremental CIL.

It is going to take about 2-3 minutes (it depends from environment to environment).

Then, to double check if the job run well, go to System Administration > Inquiries > Batch Jobs and look for your job. It status should now be Ended.

That's all for now folks. Until the next time.


Monday, September 10, 2012

Creating a Retail Store in AX 2012 Retail


Hi there,

I hope everyone is ready for a new AX filled week, and that you had a good weekend. This week I have a lot of work ahead of me, but I wanted to take the time and share with you the steps necessary to create a retail store in AX 2012 Retail.

The creation of a retail store requires many steps and some planning. I would like to extend my gratitude to Liam Breslin for his knowledge on this topic. He is a Senior Consultant for Junction Solutions and he specializes in Retail. You can contact him on his LinkedIn profile for any questions you might have about AX 2012 Retail.

So, let’s go to the good stuff now and let’s create retail store in Microsoft Dynamics AX 2012

1- Go to Retail > Common > Organization

2- Click the Organization Hierarchy tab button to create a new organization hierarchy.

3- When the new window opens, click New and assign a name to the new organization hierarchy (i.e. Retail Store).


4- Then click the Assign Purpose button to open the Organization hierarchy purposes window. In here we need to link the Organization Hierarchy you just created in step 3 with the organizational chart portion of AX.  To accomplish this, click the Add button to add a new Assigned Category. Once you have created the assigned category, click the Set as Default button. This will set your configuration as the default one to carry on later on the process.


5- When step 4 has been completed, click the Retail Assortment menu on the left and follow the same process you executed in step 4.


6- When finished you should see the following

7- Then go to Organization Hierarchy and click the Organization Hierarchy view. When the Hierarchy Designer opens, click the Edit button.


8- Click the Insert button and choose Legal Entity

9- The legal Entity (i.e. CEU) will appear in the Retail Store designer.

10- Click as Save as Draft. On the Save Changes windows choose “Save as draft” and click OK.


11- Then you to Retail > Common > Retail Channels > Retail Stores


12- Click New Retail Store and fill the required fields.


13- Go to the miscellaneous fast tab and make sure you have your payment methods. On this, for some reason in my environment, the Credit Card Payment method needed to be setup to 2 and not 02.

14- If all goes OK, you should see the following.


15- Now, go back to Hierarchies to add your new Retail Store to it under your organization. For this, click the Edit button and choose “Keep working on this draft” and click OK.


16- Click the Insert button and choose Retail Channel.


17- From the Retail Channel window choose your new retail store, and click OK.

18- If all is ok, you should see something similar to the picture below.


19- Save your new model as draft again.


20- In order to make the model “official” within AX, we need to publish it. Do this by clicking Publish and Close the Viewer.


21- Select the effective date when you want this model to be active and click the Publish button.


22- You should see the following message.


Once you have created your retail store(s), then you can create assortments and assign them to products and/or product groups to be publish into the retail channels. The assortment(s) will then be transferred to the AXRetailPOS database through an N-JOB.

I will cover this portion in one of my next post.

Until then!


Thursday, September 6, 2012

Zip Codes Upload in AX 2012


Hi there,

Today I would like to discuss how to load Zip Codes to AX 2012 from a Text file and also point out what happens in the background.

In AX 2012, this task is fairly simple as there is an abstract class (AdressZipCodeImport) that takes care of this function. In addition to the abstract class, there is another class (AdressZipCodeImport_US) for each specific country that overwrites the ReadFile() method in the AddressZipCodeImport abstract class. In AX 2012, there only 4 countries available for Zip Code upload.

AddressZipCodeImport Class:


AddressZipCodeImport_US Class:

The AdressZipCodeImport_US class ReadFile() method contains a while loop that will allocate the data from the file being read  into the LogisticsAddress variables. To accomplish this, you will have to have your zip code, city, state and county name in an Excel file where you create the required spaces between fields and then save it as space delimiter file.

ReadFile() Method:

The following is an example of this sequence:


The following is the ReadFile() sub string coordinates:


When your file is ready, you can upload it by going to Organization Administration > Setup > Addresses > Import Zip/Postal codes:

Once you run this, the data will be in the LogisticsAddressZipCode table


It is very interesting to see how the AX 2012 team has put a lot of thought into these common tasks as they help us be more efficient on something we don't need to really spend a lot of time figuring out.

Until the next time!

Wednesday, September 5, 2012

Spotlight - Formula 1 Team Races With Microsoft Dynamics


Hi there,

I hope you are having a great week and that you are ready to hear great news about Microsoft and its effort to introduce Microsoft Dynamics to every business.

From the article:

"This spring, the Lotus F1 Team and Microsoft announced a three-year partnership that stamped the Microsoft Dynamics name on the team's cars and its drivers' overalls.

But the deal goes well beyond logos. The Lotus F1 Team is using Microsoft Dynamics AX to help fine-tune and drive every aspect of its business, from managing the design, manufacturing and testing of the 20,000-plus parts on each car to analyzing real-time data from the racetrack"

I'm super excited about the news as it reinforces my belief that we have a platform that just works in every industry, in every business, every time. No wonder why the AX 2012 logo "Powerfully Simple" says it all.

You can read the article here.

Until the next time!