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 #SeniorConsultant #DataLover #DataMigrationSpecialist #DynamicsCRMSpecialist #Challenger #Fitness-freak #Blogger #TechnicalTrainer #TechnologyLover

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