Skip to main content

Posts

Showing posts with the label HowTo

First look at Azure Functions

Azure Functions allows you to write code that can be triggered by an event or timer. You don’t need a machine to run it on. All the computing runs on the Azure cloud ie sevrverless computing. Below is a quick walk through. Keep in mind Microsoft has great documentation on their site. Just google it. In this post I will put a simple walkthrough. Save you from the information overload. Make sure you are using Visual Studio 2017. Create a project of type “Azure Function” Give it a minute to resolve the NuGet package. You will see a warning icon and watch it disappear by it self. Once its done. Right click and Add item. Select the type of function. The easiest to do is the Http trigger. This will create a class with some sample code. When you run it, it will run a local instance. Navigate to the URL and watch it run. There are many applications in the Dynamics space. Hopefully next time I can cover some Dynamics scenarios.

Part 1–Create an Azure IoT Hub and Device

This is not AX but this was a nice experience. I worked through some labs to interact with Azure IoT Hub. There is a lot of information out there on the web. So, I will focus on the the IoT Hub only here. On later dates, I may get into the other features of the IoT services in Azure. Below are the steps to create a device in IoT Hub to get you started. After you have created your device, you can interact with the device in multiple ways. Go to Azure and Create a new IoT Hub App. Enter the required information. Now you can Add Devices manually through the Azure Portal. Otherwise, you can use the SDK to add the device via code. Now, I will show how to add the device via C#. Create a new Console project. Add the reference via NuGet. Search for Microsoft.Azure.Devices and Install it. Below is the code to copy and paste. Make sure to change the connection string to point it to your IoT Hub. using System; using System.Collections.Generic; using System.Linq; us...

Install an application x++ hotfix [AX7]

Microsoft has document this well on the wiki but can be confusing for first time. Also, things are improving and sometimes hard to keep up. This is what you see on LCS when updates are available. This wiki page walks you through the steps for applying a Microsoft Dynamics AX deployable package on a Dynamics AX system. This package can be either a binary hotfix for Application Object Server (AOS) or a deployable package that was created in your development environment. Apply a deployable package on a Dynamics AX system https://ax.help.dynamics.com/en/wiki/apply-a-deployable-package-on-a-dynamics-ax-system/ The most misunderstood part is the application x++ updates. What you are downloading from LCS is the x++ code. You are not downloading a deployable packages. A deployable package is a compile output that you can use to install to your none development machines. Below link guides you how to install it. Install a metadata hotfix https://ax.help.dynamics.com/en/wiki/configuring-...

Dynamics AX 2012–How to investigate SSRS errors

Recently I was investigating an issue when printing customer statements, randomly I was getting errors. The error wasn’t really helpful as it gave a generic error in the infolog. So, in this post I will explain how to investigate SSRS errors and hope it helps others out there. What is the Error An error occurred rendering the report. Accessing the report server URL  caused an error. The remote server returned an error: (500) Internal Server Error. Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' was thrown.    at Dynamics.Ax.Application.SrsPrintMgmtController.Outputreports() in SrsPrintMgmtController.outputReports.xpp:line 96    at Dynamics.Ax.Application.CustAccountStatementExtController.Runprintmgmt() in CustAccountStatementExtController.runPrintMgmt.xpp:line 129 Step 1 – Check SSRS log files The first place is obviously the event viewer. That generally won’t give that much more information from my ex...

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

Dynamics AX 7 Development I – Create a model

With the recent release of AX7 CTP8 public preview there are a lot of things to learn. I thought I would do some basic series of tutorials to explain a few concepts and how to get around for developers. In this first one I will explain how to create a model. Click on Dynamics AX > Model Management > Create model Follow the wizard by entering a name and a publisher This is very important if you want to create extensions or if you want to customise existing functionality by over-layering (which we try to avoid as much as we can). After you finished you can create a new project in that model. In the Application Explorer there are two views Model View – Shows the AOT divided into its models. Each model has its own subset of the AOT (elements that belong in the model) Classic View – Shows a single AOT classic view we are used to You will notice in the Packages folder that the model folder was created under the application suite. Good reference material available ...

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

Multithreading with Business Operation Framework [AX 2012]

In this post I will discuss the basics of multi threading with business operations framework and I will provide a sample you can work with. Multithreading can give you a huge performance boost if you could spin each process separately. The biggest hurdle with writing a process to work via multi threading can be a little confusing and time consuming to develop. So, what I have done is create a generic xpo project which I have used many times as a starting point. Below is a screenshot of what the net result is of my sample project. The xpo contains the following project. Download xpo The \Classes\Processor\process method is the main entry method. If it is run with out the batch it will execute each record separately. Otherwise, if it is run in batch it will bundle the records based on a default bundle size (I have set it to 10). I then use a list to store the 10 customer recIds. The reason I bundle the records is because when you multithread, you may not want to process each r...

Walk through of PowerBI

On 24th of July Microsoft announced the release of PowerBI . With that comes a lot of new features and I have to say it is a lot simpler to use. In this post I will walk you through what I did to get my first report done in 10 minutes. Download PowerBI Desktop and install it. (No need to show installation steps as it was super simple to follow the wizard). https://powerbi.microsoft.com/desktop Once that is done, I signed up on the website with my work email (we are already on Office365). First thing to do is give it a data source. In my case I chose OData to get AX data. You will get the list of data sets available in AX. I selected one of them and manipulated some of the columns. Usual thing you would do is rename the columns, maybe do filtering or grouping. You may add additional data to link to. Then next thing you do is click on the Load (Close & Load button). Once it is loaded, you can start creating the report. I did a basic pie chart. You then can click on th...

How to debug xslt transformation using visual studio [AX 2012]

Dynamics AX 2012 has introduced the ability to transform an xml message using xslt. Refer to the technet article for more information on transformation of inbound ports http://technet.microsoft.com/en-us/library/hh352243.aspx Also see this nice blog post on importing bank reconciliation files using standard BAI formats  http://blogs.msdn.com/b/axsupport/archive/2014/05/20/advanced-bank-reconciliation-setup-in-ax-2012-r2.aspx Back to the topic - In this post I will show you how to debug and run the transformation in visual studio 2010. First thing you do is open up the xslt file with Visual Studio. You will see the xml editor tools on the toolbar. If you dont see it, then just right click the toolbar and add it by selecting the “XML Editor”. Now you can place a breakpoint in the document and click the start xslt debugging button (Alt +F5). First time you run it you will get to choose the input file. If you have run it before this will be defaulted. You can change it by goi...