Thursday, 18 August 2016

Create a new partition [AX 7]

This is a deprecated feature but still works for simple testing. I used it mainly to test importing of configurations in a new clean environment.

To create a new partition, you must put the form name at the end of the URL.

https://usnconeboxax1aos.cloud.onebox.dynamics.com/?f=partitionadministration

image

Create a new one and save it.

To login to the partition, you must do a similar URL parameter by adding the partition name.

https://usnconeboxax1aos.cloud.onebox.dynamics.com/?prt=newPartition

Note, that the partition have their own data through out. Companies and security must be set up individually.

Reference: https://community.dynamics.com/ax/f/33/t/198960

Sunday, 17 July 2016

Tax calculation on Net amount - Gotcha

In AX you have various ways of calculating tax. The one that is most confusing is calculating on the Net amount.  I thought I would show a few examples where you can get caught on this.

Notice below an example with negative lines. See how the distribution looks wrong but it is right. It distributes the rounded tax amount based on the total of the invoice.

2016-07-17_10-03-25

Another simpler example where the total of the invoice is zero. There is no tax calculated.

2016-07-17_9-56-57

There a few things you should consider when choosing this method.

  1. Do not add the Tax amount column on the Invoice report. This can make people say it is calculating incorrectly and you having to explain this problem. Standard AX does not have the tax amount column for this reason.
  2. If you are integrating with another system, make sure your method of calculating tax is the same. For example, if you are integrating an ecommerce web site with orders.

Download the excel file for a working example. Follow the instructions and enter your own values in the yellow cells. It will calculate based on the total, rounded to two decimal places.

xlsx

Note there are other methods of tax calculating, including line based.

Note: GST is Goods and Services Tax in Australia. It is set at a flat rate of 10%.

You can change the tax percentage in the file.

Friday, 17 June 2016

Tip of the day: Set up one environment at a time on LCS

When setting up new environments on LCS, always try to set up one at a time. This is so that you have a bit more control over your environments.

Here below I have set up a Developer and a Build VM in one shot. You will notice the controls to start and stop the images are for both VMs.

2016-06-15_0645

Monday, 6 June 2016

Hide dimension attribute using XDS [AX 2012]

This was something I had a look at recently. I had to hide certain dimension for specific security roles.

I won’t go into the details of why as that is another longer conversation.

This can be achieved using XDS (security policy).

2016-06-01_1101

2016-06-01_1102

One thing you have to keep in mind is if a dimension is defaulted it will contain a value.

I set up a vendor with a default dimension as per screenshot.

2016-06-01_1109

On the form it showed the 3 dimensions but in the database it was actually defaulting as above full 5 dimensions. This is because it is defaulting the RecId reference to the dimension value combination.

2016-06-01_1110

Monday, 23 May 2016

AX 2012 R3 Entity Store

Recently there was a release of the entity store for AX 2012 R3. This is a great tool that makes data warehousing simple and close to real time. Traditionally with a data warehouse, you would have to do full updates. This is fine for overnight process but when it comes to regular updates, it is a bit much to ask.

Here are the links to Microsoft blogs of the release announcement:

https://blogs.msdn.microsoft.com/dynamicsaxbi/2016/05/02/introducing-entity-store-for-dynamics-ax-2012-r3/

https://blogs.msdn.microsoft.com/intel/archives/185

The concept uses DIXF to do incremental updates to the secondary entity store database. This is done using change tracking which is enabled at the database level.

One thing to note is, the entity store database should ideally be on a different server. Allowing you to have SQL 2014 or latest SQL 2016 installed. The entity store uses column store indexing which is super fast. Have a read of the whitepaper in the above links. Below is a diagram of what is intended.

2016-05-03_1852_001

You can download a KB or wait for the next CU to be released soon.

After downloading the KB installation file – you will get a kernel and an application update folder.

2016-05-03_1844

The hotfix contains a few extra related KBs. Nothing major and should be able to identify any conflicts pretty quick.

2016-05-03_1851

Now that it is installed, you have a couple extra menu items.

2016-05-17_1612

Before you can start setting up the entity store. You have to create the ODBC connection to an empty database. This is a manual process (ie. create it in SQL Management Studio).

Once you have done that, you can set up a connection. This is the same as the normal DIXF connection but defaulting to ODBC to make it simpler. Click the Validate to make sure it is OK.

Then click on the Publish, which launches the entities to publish.

2016-05-17_1614

I did a quick simple one here.

2016-05-17_1618

In the Manage refresh schedule menu, you can start to push the data. A couple of nice features on there.

To do incremental or full push of data.

Skip the staging table (good because you don’t want to have too much data in your production database).

I haven’t figured out the last flag yet. Maybe next time.

2016-05-17_1619

Looking at SQL it maintains the update with the DIXF execution id.

2016-05-17_1618_001

In my opinion this is really exciting. It is bringing regular incremental updates, a data warehouse which you can extend to build on. Then it is a matter of using PowerBI to do your reporting and presentation.

Thursday, 28 April 2016

Expose AX 2012 AIF services (SOAP) as RESTful web services

A colleague of mine Fabio Filardi has published his work on Github. It has two samples for the Expense services and UserSession services. He has documented it really well. Get onto it if you are going to expose your web services as RESTful. It does save you a lot of time.

Github project

https://github.com/ffilardi/AxaptaAPI

Documentation under wiki

https://github.com/ffilardi/axaptaapi/wiki

 

Here are some additional notes. Microsoft has documented it really well too. So, get your head around the concepts and the above links should be of great benefit to you.

This is a good summary of the Azure service bus adapter with AX.

http://blogs.msdn.com/b/aif/archive/2013/04/29/aif-windows-azure-service-bus-adapter.aspx

Whitepaper from Microsoft on how to extend it. Microsoft provides an example by talking about mobile app. Concept is how to expose your web services securely outside the domain.

https://www.microsoft.com/en-us/download/details.aspx?id=38413

Fabio has written a blog on one of the on this topic last year.

http://www.uxceclipse.com.au/Pages/Blog-Detail.aspx?newslist=Blog%20List&itemId=81

Be aware of the licensing cost for Azure. This is from Microsoft blog about the cost associated with Azure service bus.

http://blogs.msdn.com/b/axcompapp/archive/2013/11/06/azure-service-bus-cost-is-minimal-for-ax-companion-apps.aspx

Wednesday, 20 April 2016

Multi threading–Adding run time tasks

Last year I posted about multi threaded operation using BOF Also uploaded a sample project you could use to test it out or use as a template.

Multithreading with Business Operation Framework [AX 2012]

One thing I picked up after testing it in a large scale project which required scheduling it on a non default (blank) batch group. This had a few issues:

Originally I was using the 

batchHeader.addTask(this.newTaskController(recIdSet));

Below are the two issues of using this method like this.

1. There is a known issue to set the controller execution mode to be Synchronous.

Whitepaper: https://www.microsoft.com/en-us/download/details.aspx?id=29215

Screenshot of the known issue.

2016-03-31_1223

This separates it as its own batch job which disappears after it is finished. This is not the desired result when we are adding tasks at runtime. We want to keep them as tasks under the main batch.

2. Another issue is it will set the batch group as the default batch (blank). In my case the blank batch group was not my ideal batch server.

I rewrote that section as per below.

2016-03-31_1220