CRM Extensions

Microsoft CRM 2013: Currency exchange rates actualization

In this article I will share with you a small add-on I developed for one of my customers.
Let’s assume that you are an employee of a company that uses CRM with several currencies. Of course, you want to have actual information in your system and the currency exchange rates should be current. Microsoft CRM allows to have in your system one base currency and many other currencies. Every currency has an exchange rate field that is used for calculation of base fields of your currency fields but there is no out-of-box possibility to actualize exchange rates.

I have added to my CRM system several currencies:

18

Using my add-on you can keep your currency exchange rates up-to-date:

22
Using my add-on is simple:
1. Download solution:

2. Import it to CRM (If you download and import an unmanaged solution, you will have to publish the solution and activate workflow).
3. Open Settings – Sync Schedules (this is a custom entity that is part of the solution) and create a new Sync Schedule record, fill in the Next Execution DateTime field (for example midnight of your current day):

4. Run the Sync Currency Exchange Rates workflow against your Sync Schedule record that you’ve created in the previous step:

Wait till the workflow is executed and then go to the currencies to check that the currency exchange rates were updated:

Screenshot of a workflow I’ve designed follows. The logic of the workflow is really simple:

  1. Wait till the next execution date.
  2. Update Currency exchange rates.
  3. Update next execution date as current plus 1 day, which will invoke the recurrent execution of the workflow.


PS: I used http://www.webservicex.net/CurrencyConvertor.asmx webservice for getting the  actual exchange rates.

16 Comments

    1. Vinod, Code that I developed should work. On the other hand it would be complicated to migrate solution because you can import it to CRM 2013 or CRM 2015. So I’m afraid that answer is no – you just can’t import solution to CRM 2016.
      Andrii

  1. Pingback: URL
  2. Hello,
    I got sync error since may:
    “A validation error occurred. The value of ‘exchangerate’ on record of type ‘transactioncurrency’ is outside the valid range.”

    Can you send me code or is there any chance that you will fix that?

    Best regards
    Petr

    1. Petr, there is a chance that response from webservice has been changed. I can send you a sourcecode if you want.

  3. Greetings, Andrii!

    The solution download does not work. Is there an updated link where I can download this solution? Thank you!

    1. Veronica,
      That solution is not available anymore. I will update post with code when I have free minute.
      Andrii

  4. Hi Andrii,
    can we update exchange rate up to date for currency using your above solution?

    1. Hello,
      Endpoint I used doesn’t work anymore. Download Ultimate Workflow Toolkit – it contains step that does similar operations using new endpoint.
      Thanks,
      Andrew

  5. Hi Andrew

    I am struggling to get the Refresh Currency Rates to work. I installed the newest version. Then created a process that executes UWT: System:Refresh Currency Rates. But when I run the workflow on the Currency page it fails , and I get the following error:

    Unexpected exception from plug-in (Execute): UltimateWorkflowToolkit.CoreOperations.System.RefreshCurrencyExchangeRates: System.NullReferenceException: Object reference not set to an instance of an object.

    Do you have any advice on what i might be doing wrong?

    Thanks

    1. Hello Rudolph,
      I believe I had to write wiki that describes everything step-by-step. Unfortunately I never had time doing it… Here is what you should do:
      1. Open solution -> Configuration page.
      2. Click “Currency Layer” portal, register yourself there and get a key.
      3. Save your key inside “Currency Layer API Key” field and Save settings.

      After that your Null Reference exception should go away. And yes, I should make those errors more self-explanatory.

      Andrew

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.