Quantcast
Channel: Dynamics NAVAX
Viewing all 219 articles
Browse latest View live

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

$
0
0

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


AX 2012 R3 Entity Store

$
0
0

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.

Hide dimension attribute using XDS [AX 2012]

$
0
0

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

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

$
0
0

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

Tax calculation on Net amount - Gotcha

$
0
0

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.

Create a new partition [AX 7]

$
0
0

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

Additional posting layer in journal names [AX7]

$
0
0

This was a nice find the other day. AX7 has introduced additional posting layers to the enum. This is great for financial reporting. It might seem like a small thing but the fact that it flows through to the GL entries and also MR recognizes it, is a great thing. Make sure to get the latest MR for it to work.

2016-06-30_15-35-31

Exchange rate providers using OANDA

$
0
0

This was done for a number of customers but it is good to see it standard in AX7.

Friday spotlight goes to …

image

Until next time. I have some exciting blog post ideas but trying to find the time.


Azure AD in new Portal

$
0
0

The #AzureAD admin experience in the new Azure portal is now in public preview!

I thought I would give it a try out with the AX7 by registring the native application on Azure AD.

See wiki and search half way in the page for Register a native application with AAD

https://ax.help.dynamics.com/en/wiki/dynamics-ax-7-services-technical-concepts-guide/

Navigate to the Azure AD in the new Portal. Click on App registrations.

image

Create a Native App and enter a Redirect URI.

image

Click on the Required permissions and select Microsoft Dynamics ERP. Then select the 3 delegated permissions.

image

Should look like this at the end.

image

Azure Logic with AX–callable endpoint

$
0
0

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.

SNAGHTML2b98aec (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                 rawResponse;
    Map                 data;
    RetailCommonWebAPI  webApi = RetailCommonWebAPI::construct();

    str _requestUrl = @'http://requestb.in/1a07xyj1';
    //str _requestUrl = @'https://prod-02.northcentralus.logic.azure.com:443/workflows/bb7f4b0c834f418cbf7d2fa969c4bcea/triggers/manual/run?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=AAAAAAAAAAAAAAAAAAAAA;
    str _postData =
    @'
    {
            "email": "munib@fakeemail.com",
            "name": "Munib A Ahmed"
    }
    ';
    str _header = '';
    str _contentType = 'application/json';

    response = webApi.makePostRequest(_requestUrl, _postData, _header, _contentType);

    rawResponse = response.parmData();
    data = RetailCommonWebAPI::getMapFromJsonString(rawResponse);
    info(rawResponse);
}

Below is what you should see in request bin.

image

Now, lets do it via Azure Logic.

1) In Azure Logic create a new app

image

 

 

3) Create a HTTP request. This will give you a URL which you can call.

image

Use http://jsonschema.net/ to copy your message and get a schema. This schema can be pasted into the HTTP request.

image

I create an action to send an custom response. I added parts of my request and some additional elements.

Run the job in AX and have a look at the response.

image

This is just a quick test but think of similar examples. You can possibly create a framework in AX where you send a message after an invoice is posted. That message could be json, string, xml or filestream. Then you can have Azure Logic send an SMS, email, integrate with SalesForce/CRM or all other connectors.

AX calling Microsoft Flow

Payment advice in AX7

$
0
0

Payment advice has now been added to the Print management setup now. This is a nice addition.

image

New button under the payment journal lines form. Payment advice button is only enabled if the Payment status is sent.

image

Dialog populates with the Vendor and Bank but you can clear it out to run for all lines.

image

Payment advice report on screen.

image

Schedule Azure machines on and off

$
0
0

I friend of mine recommended this cool tool for scheduling machines on Azure. This is really good for saving Azure credit. You can schedule to turn on a machine before you start work and turn it off after work. Make sure it turns off over the week, incase you have forgotten.

Here is how simple it is. Connect up and select your machine. Then schedule.

image

 

Plus they have a FREE plan.

Change password of web config file [AX 7]

$
0
0

It is good practice to change the Administrator password. You might want to be extra secure and also change the other accounts (service accounts).

You will notice that the web config file is encrypted when it comes to passwords.

image

You can use the following commands to encrypt/decrypt the file.

 

To decrypt run this command:

C:\AOSService\webroot\bin\Microsoft.Dynamics.AX.Framework.ConfigEncryptor.exe -decrypt C:\AOSService\webroot\web.config


To encrypt run this command:

C:\AOSService\webroot\bin\Microsoft.Dynamics.AX.Framework.ConfigEncryptor.exe -encrypt C:\AOSService\webroot\web.config

 

If you make changes you may need to reboot the machine. Restarting IIS didnt work for me when I changed the passwords.

Install an application x++ hotfix [AX7]

$
0
0

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.

image

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-and-installing-a-metadata-hotfix-package/

Below is how you do it using the visual studio addin rather than command line. Saves you a bit of time.

Click on Addins > Apply Hotfix

image

It defaults the parameters but you have to browse and select your file.

image

Visual studio will try to process. You can see Task manager to see that it has kicked it off.

image

It may take a few minutes but you will get a message.

image

Check that it has been applied.

image

Important:

  • Addins can change at any time. So, learn the proper way from the Microsoft Wikis. Know what it is doing.
  • You can create your own addins to improve tooling. That is why Visual studio is so great.

Referencing a form control [AX7]

$
0
0

I am seeing this a lot more these days because of extensions in AX7. You tend to take the form run in the event and try to get a form control.

A lot of developers seem to be hard coding the control name. Not wrong but not the best way to do it. A form control name could change or be deleted. Then you wont catch this until a user runs it.

Not so good way:

formRun.design().controlName(“MyControlName”)

formRun.design().controlName(identifierStr(MyControlName));

The right way:

formRun.design().controlName(formControlStr(MyFormName, MyControlName));

This way you get your errors during compile time.

Right click context in AX7

$
0
0

In previous versions we had the ability to override showContextMenu to achieve right click in various controls..

This used have pop the menu and wait for a user response to continue. This concept of waiting for a response doesn’t exist in AX7. So, it has been split into two methods:

  • getContextMenuOptions
  • selectedMenuOption

Do a search in the AOT for code examples it’s relatively straightforward.

AX 7 Working with Version control

$
0
0

This is the landing page for setting up your development environment with version control.

https://ax.help.dynamics.com/en/wiki/using-development-tools-in-ax7/

This is relatively easy and setting up a new solution/project works without a problem. In this post,I want to highlight a little gotcha. If you open up a solution and notice the project isn’t bound to version control. i.e. No padlock icon, not able to check out

Then it looks like you may have to bind the solution. Open up the solution using source control explorer. You should get this message asking you to bind it. Click on Yes and follow it.

image

Following screen you get.

image

Otherwise, create a new solution that and make sure to tick the “Add to version control” flag in the dialog.

Part 1–Create an Azure IoT Hub and Device

$
0
0

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.

2016-10-29_12-20-27

Enter the required information.

2016-10-29_12-21-50

Now you can Add Devices manually through the Azure Portal. Otherwise, you can use the SDK to add the device via code.

image

Now, I will show how to add the device via C#. Create a new Console project.

Add the reference via NuGet.

2016-10-29_12-27-16

Search for Microsoft.Azure.Devices and Install it.

2016-10-29_12-26-59

2016-10-29_12-27-41

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;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.Devices;
using Microsoft.Azure.Devices.Common.Exceptions;


namespace CreateDeviceIdentity
{
class Program
{
static RegistryManager registryManager;
static string connectionString = "HostName=DAXIOTHUB.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=xxxxxxxx";
static void Main(string[] args)
{
registryManager = RegistryManager.CreateFromConnectionString(connectionString);
AddDeviceAsync().Wait();
Console.ReadLine();
}
private async static Task AddDeviceAsync()
{
string deviceId = "myFirstDevice";
Device device;
try
{
device = await registryManager.AddDeviceAsync(new Device(deviceId));
}
catch (DeviceAlreadyExistsException)
{
device = await registryManager.GetDeviceAsync(deviceId);
}
Console.WriteLine("Generated device key: {0}", device.Authentication.SymmetricKey.PrimaryKey);
}
}
}

Credit to Microsoft for the Labs. Lab doc I found was a little old but most of the steps worked.

Reference:

https://azure.microsoft.com/en-us/documentation/articles/iot-hub-csharp-csharp-getstarted/

Dynamics 365 for Operations mobile platform–Part 1

$
0
0

This is my first attempt at the mobile solution. Here are some findings.

I downloaded the Android version which you can download from the Play Store.

Have a read of the wiki site. It is well written.

https://ax.help.dynamics.com/en/wiki/mobile-development-handbook/

First thing you will get is the sign in screen.

Enter the URL for Dynamics 365 for Operations. Enter the company code. The application is company specific.

image

Accept the terms and conditions.

image

You will be navigated to the login screen.

image

Allow access to your media on your device.

image

You will be presented with a blank workspace and some menu options.

image

Next post I will write about configuring it.

Viewing all 219 articles
Browse latest View live