Automate Currency Exchange Rate Updates in Business Central/NAV


 Setup the Exchange Rate Service


From the Currencies Page, select Exchange Rate Services on the Ribbon.



Open the page and select New.

In this window, put in the following details for your new Currency Exchange Rate Service:

currency exchange rate screenshot 3

Next, open the Field Mapping area and populate the Source, Default Value, and Transformation Rule columns as follows:

  • Source Field:
    • Parent Node for currency code: /channel/item/targetCurrency
    • Currency Code: /channel/item/targetCurrency
    • Starting Date: /channel/item/pubDate
    • Exchange Rate Amount: /channel/item/exchangeRate
  • Default Value:
    • Relational Exch. Rate Amount: 1
  • Transformation Rule:
    • Create A New Service (FLOAT_DATE). See Below.

FLOATRATE configuration screen for currency update service screenshot

Next, you will need to create a New FLOAT_DATE transformation rule to handle the dates in the XML format. Click the dropdown for the Starting Date Transformation Rule and press New.

currency exchange rate screenshot 5

Fill out your New Rule form as follows:

  • Code: FLOAT_DATE
  • Description: Floatrate date transformation
  • Transformation Type: Substring
  • Next Transformation Rule: US_DATE_FORMAT
  • Starting Text: “ ” (THIS IS A SPACE NOT BLANK)
  • Ending Text: “ GMT” (This is a Space, then GMT)
currency exchange rate screenshot 6

Press OK to exit the rule. Then select this new Transformation rule on your FLOATRATE service for the starting date field mapping.

currency exchange rate screenshot 7

Enable the FLOATRATE Service

Now that you have created the service, you need to enable it. Press the Enable Button, which will create a job queue entry (if it does not in your version you will need to manually create a Job Queue Entry). You should get a message to open the Job Queue Entry created.

currency exchange rate screenshot 8

Review and update the Job Queue Entry and set to Ready. Then, make any changes you would like to the Job Queue entry (add a description, set the starting time, days to run, etc.). Set the No. of Minutes between runs to 1440 (24 hours).

Note that the Job Queue Entry must be in Hold status to edit.

 Set Status to Ready to schedule the Job Queue Entry when you are finished editing.

currency exchange rate screenshot 9

 

Check your Service to see the results:

Now that you have set up and enabled your service, open the Currency Exchange Services page (you can get there from the currencies page the same way you did in step 1).

Press the Preview button to see the Log of the currency updates performed.

currency exchange rate screenshot 10

Here’s an example of what your currency exchange rate updates page will look like.

currency exchange rate screenshot 11

And here is an example of the corresponding table of currencies you will generate.

currency exchange rate screenshot 12



No comments:

Post a Comment