How to update currency rate automatically on demand

1 minute read time.

This blog is about how to update currency rate automatically on demand specially for clients who operate internationally and want to update their multi-currency rates in the system. 

Overview of this feature

To get currency rates automatically updated in X3 from currency rate provided openexchangerates.org(https://openexchangerates.org) we connect to Sage service called FX service that connects to Open Exchange Rates

The exchange rates taken from the service are the rates announced on the previous day. In X3 they are saved with the next day rate.

Note: One can download a currency rate for a currency only if at least one rate for that currency already exists in the table X3

Setup and workflow of function update currency rate FUNCURRAT on demand

Step 1: Define REST web service CURRATAPI in X3

Name: CURRATAPI 

Base URL: one of the above endpoints - for production environment should be: https://prod.sharedservices.sage.com/api/FXRateEndpoints/rates 

Content Type: JSON , Authentication: none . No additional headers or parameters in the setup.

NOTE: Test GET action will not work on the REST web service definition because X3 uses POST method with body in the request being sent to the FX endpoint.

Step 2: Create task definition for updating currency rate in function Task management (GESABT)

Task code: CURRATAPI , Description: Currency rates , Module: Common data , Task type: Processing

Function: FUNCURRAT

One time execution using Query submission (EXERQT)

Verifying Task CURRATAPI have been executed successfully in function Query management (AREQUETE)

Step 3: Recurring task definition in Recurring task management (GESABA)

It may be defined automatic recurring task run for example early morning (7 am UTC) to update currency exchange rates for the previous day "End of the day" which are relevant for the current day. Below example:

Task code: CURRATAPID, Periodicity: Weekly

Weekly: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday , Time: should be adjusted to be equivalent to 7 am UTC.

Parameters: works the same as described above in "Query submission".