Friday, March 27, 2015

Creating Exchange Rate Providers in Microsoft Dynamics AX 2012 for Xignite



Microsoft Dynamics AX 2012 has the frame work for integrating currency exchange rates from exchange rate providers. Please reference Creating Exchange Rate Providers for Microsoft Dynamics AX 2012. The referenced document from Microsoft shows how to customize the frame work to work with Oanda Exchange Rates .

There are other providers, some which offer a fee based API and others which offer a free API. Doing research on these providers led me to Xignite. They offer a fee based API, which is fairly competitive with other providers.

This blog entry uses the referenced document from Microsoft as a guide to create a provider class in Dynamics AX specifically for use with Xignite API.

The provider class we will create will be the fee based provider. The fee based provider allows for selection of base currency, and specific currency pairs.

Create the class as ExchangeRateProviderXigniteRates and have it extend the ExchangeRateProvider as shown in the class declaration below.

Note: The ExchangeRateProviderIdAttribute is a unique ID that you will need to supply. You can obtain a unique ID from http://createguid.com


Now create a method called getConfigurationDefaults. This method will provide the default URL used to make requests to the provider.


Next create the getExchangeRates method. This method is responsible for constructing the URL to request the currency information from the provider, and store the results in the currency exchange rate tables of Dynamics AX.



Next create the getName method. This method is used by Dynamics AX to populate the list of providers that Dynamics AX has been modified to support.


Once the getName method is created, create the getProviderId method. This method simply returns the unique GUID that was assigned in the class declaration.

Next create the getSupportedOptions method.


The last method that needs created is the readRate method. It is responsible for parsing the XML response string from the provider, and storing the exchange rate and currency information in the Lists.


Now that the class has been created, it can be used in currency configuration and setup within Dynamics AX.







currency2







1 comment:

Unknown said...
This comment has been removed by the author.