Posted in Dynamics CRM

Override the Exchange rates in Dynamics CRM

Today, we came across a scenario that we need to override the default behavior of exchange rate calculation. Whenever modifying the active records which has currency fields, money fields will be recalculated based on the exchange rate available in the system.  For some cases, we may need to stop this behavior. That means, instead of taking the exchange rate from currency master, It should take the user provided value.

After going through so many forums, we finally decided that we could go by intercepting the “RetreiveExchangeRate” message.

Two steps:

  1. Somewhere you have to maintain the custom exchange rates so that you can pass to the plugin while you intercept that. It purely depends on the situation.
    • Maintain your exchange rates in custom entity
    • Maintain your exchange rates in the same record itself
  2. Write a plugin which will intercept the message “RetreiveExchangeRate” and pass your exchange rates instead of the system exchange rates

Hope you got idea on how to Override the exchange rates in Dynamics CRM.

If you need code for this, Please ping me in comments.

Happy Blogging !!!

Advertisements

Author:

#enthusiastictechnologist #developer #consultant #freelancer #microsofttechnologies #dynamics365 #azure #datalover #datamigrationexpert #challenger #fitness-freak #blogger #technicaltrainer

3 thoughts on “Override the Exchange rates in Dynamics CRM

      1. I need to override the system exchangerate by the value informed in a custom field exchangerate created on my quotes in dynamics CRM online (when activating, closing or reviewing them etc) to calculate _base currency fields based on my custom exchangerate field instead of system exchangerate.

        I already have this custom field created to my quote entity, but I am not a developer and I don’t know how to write and apply a plugin on the entity : Transactioncurrency for the message RetrieveExchangeRate to Override the OutputParameter with the custom Exchange Rate value I want to be used on quote.

        I need something like this (but on quote entity): https://stuffandtacos.azurewebsites.net/2016/10/13/how-to-override-the-exchange-rate-of-an-opportunity/

        Regards

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s