Skip to main content

Posts

Showing posts with the label AX2012R3

Table casting in AX 2012 and D365O

D365O is a lot more sensitive about casting or should I say AX2012 was too relaxed about it. This post is to show a specific scenario that works differently in the new version of the product. We had a bit of code that worked fine in AX2012 but stopped working in D365O. After debugging we found that when you cast a table it took the tableId of the cast. Below is an example of AX2012 vs D365O: UPDATE – Thanks for Joris for pointing this out. Same code running in CIL in AX2012. The piece of code in question was running client side. Otherwise, I would have noticed this in AX2012 too.

Hybrid connection - Web Api App for AX 2012 to Azure-part 4

This is the final post of this series. Web Api App for AX 2012 to Azure–Intro Deploy a Web Api App for AX 2012 to Azure–part 1 Application settings - Web Api App for AX 2012 to Azure-part 2 Authentication - Web Api App for AX 2012 to Azure-part 3 Hybrid connection - Web Api App for AX 2012 to Azure-part 4 (this one) In this post we will set up a Hybrid Connection. This is basically a listener that sits on your on-premise server. It will expose internal port to Azure. More information on Hybrid connection on Microsoft’s site. https://docs.microsoft.com/en-us/azure/biztalk-services/integration-hybrid-connection-overview In your Api App, click on Networking. Then click on “Configure your hybrid connection endpoints”. First download the connection manager. Install this on your on-premise server that you want to install the listener. You don’t have to run the connection manager just yet. Set up the hybrid connection by clicking on the “Add hybrid connection” Click on the “Create new hybrid...

Authentication - Web Api App for AX 2012 to Azure-part 3

Lets set up the authentication in this post. You should always secure your application and never leave it exposed out to the web. Click on Authentication menu and turn it on. In the drop down, select Azure Active Directory. In the Authentication providers click on Azure Active Directory to start configuring it. Select the Express mode. This will create an web App registration. Once authentication is configured. Lets set up a native Application registration. This step is only required if you are trying to communicate to the web service via a desktop applications, mobile application, third party tools to access your web services. More information on application permissions and authentication on the Microsoft article. https://docs.microsoft.com/en-au/azure/active-directory/develop/active-directory-authentication-scenarios Navigate the the Active directory menu and click on Application permissions. You will see the “Web app/API” application registration. We will create a Native application...

Application settings - Web Api App for AX 2012 to Azure-part 2

Last post showed how to publish your solution to Azure. This post will show you where to modify the the application settings. In visual studio you would be modifying the web config file. In the cloud you will modify the Application settings. Find your Api App. Click on Application settings. Scroll down to App settings.

Deploy a Web Api App for AX 2012 to Azure–part 1

Continuation from previous post. In this post I will show how  publish your solution to Azure. I assume you have followed the instruction from the GitHub wiki to download and configure. https://github.com/ffilardi/AxaptaAPI/wiki Now that you have done that. Lets deploy. Create a new Api App. You might have to search for it if its not available on the menu. Give it a name and select a Resource Group. Obviously pick a data centre location that is close to your AOS. If I am not sure, I like to use this site to find the closest with the lowest latency. http://www.azurespeed.com/ Now you have an empty Api App. Grab the Publish file by clicking the “Get publish profiles”. This is not necessary but if you have other developers who don’t have access but you want them to publish. This one of the ways. In Visual Studio right click on your project and click Publish. Follow the wizard. You can sign in and select the Azure resource to deploy it to. Otherwise, use the publish file to import and ...

Azure Logic with AX–callable endpoint

There are lots of ways to work with Azure Logic. This will be my first of many hopefully to show you how you can use Azure Logic with AX. Have a read of this post from the Azure Logic team first. It explains how you can create a callable endpoint in Azure Logic. Logic apps as callable endpoints In my post I will show you how you can use AX to call an Azure Logic endpoint. (I am not a graphics guy but the little fire on the end of the rocket is my addition) First start by writing a job that sends a post message to request bin . Request bin is a good site which you can use to send a message to it and it displays the results in a readable way. Navigate to request bin and copy the URL into the job. Then run the job to see the result. static void _jsonJob(Args _args) {     RetailWebRequest    request;     RetailWebResponse   response;     str           ...

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). 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. 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.

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...

Complex grouping of records for processing [AX 2012]

In this post I will discuss complex grouping of records for processing in a batch.There are many ways to achieve this but most of the time I see developers using temp tables. I feel that is not necessarily the most best way. So, in this post I will show how you can do the same using a map and a RecordSortedList. Avoiding multiple loops through records and also avoiding temp tables. Scenario Assume a scenario where you have to loop through unsorted records. Group them by the multiple fields including things like financial dimension value and balance. Then create a journal for each group. Options This could be achieved in a number of ways. But we want the best performing and extendable solution. You could do a group by selection query but that won’t work as you have to get the balance and dimensions (which are calculations). You could use a temp table to insert all the transaction. What if the key changes a few months later. Could be costly to develop the changes. You could use ...

Resolve the ledger dimension in the a different account structure [AX 2012]

Recently I had a look at an error that occurred on a custom journal posting routine. It was somewhat similar the journal allocations by looking at existing transaction to make adjustment. What I didn’t know is the account structure has changed. An error popped up: Account structure X for the combination x-x-x-x-x, is not valid for the ledger X.   When ever using ledger dimensions don’t just stamp the LedgerDimensionRecId. Use this method to resolve the RecId in the current account structure for the current company. toLedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension(fromLedgerdimension); I had to do a quick unit test to prove this. Below is a job that converts. Code: static void resolveLedgerDimension( Args _args) { //My expected values are //Dimension display value = '1.1.4.2.03--' //Account structure and dimension From RecId - Brazil - 52565566264 //Account structure and dimension Resolved RecId - Brazil SI - 2256553...

KB2996035 - Performance issues when printing 1000s of customer account statements

A bit of a spotlight on this KB. This is not in AX2012R3CU9 but available on LCS for download. When you are printing a large number of customer statements it can take hours to print. This can be cut down dramatically. I don’t have perfect stats but with our testing on a TEST box. It ran 2.5 times faster. Producing over over 3000 statements in 30minutes. I think with better infrastructure we can get much better results. (12GB x 4 Cores test box – was a shared box for other services) The more cores the faster it is. The installer contains 2 KBs in one. The code is generic in nature but requires that you still make a small change to the code. Not sure if this was forgotten. Add this method to the controller class of the report. Final result should show you a new check box “Use parallel processing”. If this is ticked then it will multi thread and the prints will be out of sequence. If you don’t tick or see this flag, you are not multi-threading.

Open journal line form is slow [AX 2012]

I have posted a few times about journal performance. Make sure to have a look at those. This one is specifically about open the journal line form being slow. I tested with a 40,000 line journal.  Opening the form took about 7 minutes. I ran the code profiler against it and found one particular method that took way too long. taxAmountJournal(). It ended up being a display method. This particular display method shows up on the form as “Calculated sales tax amount”. After right click and hiding the field, the load of the form is instant. Same when jumping (focus) from line to line.

KB3034554 - Ledger journal performance [AX 2012]

A bit of a spotlight on this KB. I wasn’t aware of for some time and now it is included in AX2012R3CU9. Problem was that each line insert/update/delete caused a tax calculation. This was more prominent when importing large journals (several thousand lines). The solution Microsoft provides in this KB is a technical solution. It gives you the ability to ignore tax calculations if you wanted to do it while importing (via AIF or custom code). I have written something previously that discusses this. http://dynamicsnavax.blogspot.com.au/2014/04/tips-to-improve-ledger-journal-import.html   https://fix.lcs.dynamics.com/Issue/Resolved/616114?kb=3034554&bugId=3360809&qc=0872aea67f72bae9e4f30e1e2f653e6071a7556b6589633dd4fdf521cd720f5b Note: This new field is not part of the DIXF journal entity. Here is a work around. Because the Fields in the query are set to Dynamic=No. Lets add it ourselves Right click and add the field. Refresh the target entity by either deleti...