Exchange Rate Providers in Ax 2012 R2 (Out Of Box)Setups and Steps to Customize, Enable New Service Providers

Solution Architecture:

5050.Exch.png

Setting Up Exchange Rate Provider in Ax 2012 R2:
In Ax 2012 R2 CU1 as Out Of Box Feature, Following are the steps that describe how to easily setup the Exchange Rate Providers.

  • You must first set up the exchange rate provider you want to use, and AX 2012 R2 comes with 3 providers ready to use in General Ledger → Setup → Currency → Configure Exchange Rate Providers :

2783.1.jpg

6403.2.png.jpg

  • Once this is done, General Ledger → Periodic → Import Currency Exchange Rates allows you to choose which Exchange Rate Type you want to import the rates for, and using which provider.
  • You can of course set one up for each rate type, and even schedule these to import periodically using the standard AX batch feature

3175.3.jpg

  • Once this has run, your rates can be reviewed in General Ledger → Setup → Currency → Exchange Rates :

1513.4.jpg

Steps to Customize and Enable New providers in Ax 2012 R2

A customization is required, where a provider class(EX: ExchangeRateProviderXXX) created extending form ExchangeRateProvider Class.

  • In the classdeclaration()
  1. Declare the Provider Id macro with value - '[ Enter GUID of the provider here]'
  2. Declare Service Current URL Macro with - '[Service URL for current date provided by the service provider here]'
  3. Declare Service on Date URL Macro with - '[Service URL for date range provided by the service provider here]'
  • In the getConfigurationDefaults()
  1. Set default values for addNameValueConfigurationPair
  2. Set ServiceCurrentURL, ServiceOnDateURL to NameValueConfigurationPair
  • In the getExchangeRateDisplayFactor() Set the Switch case from 1-1000 Exchange Rate Display Factor.
  • In the getExchangeRateFromNode() set the loop to get the ExchangeRate from the XML Response node.
  • In the getExchangeRates() set the ExchangeRateRequest which sends a request to the Service Provider using the web service and sending the Request XML.
  • In the getExchangeRatesFromService() pulls the data from the response XML file and distributes the data to the respective fields, Assert, and Revert the FileIO Permissions.
  • In the getName() return a string with name ‘[Service Provider Name]’ to Display it on form.
  • In the getProviderId() consume the macro declared in the class declaration.
  • In the getSupportOptions() set parm methods for options for CurrencyPairs, SpecificDates, ISO Currency.
  • In the providerId() return the providerId received from getProviderId Method.

Compile the objects, resolve syntax of BP errors/Warnings If any, Create labels for the text and then Generate Full CIL.

Hence that Enables your service provider as shown below:

3632.Exch.png

Dear Hari,

can we have full CLI command as i am functional so no idea about developer side just basic knowledge so.