Dynamics User Group
Since 1995 - The Microsoft Dynamics Online User Community

RetrieveExchangeRate plugin Message

rated by 0 users
This post has 2 Replies | 1 Follower

Not Ranked
Male
Posts 9
Points 90
Member since 05-30-2008
Kenny Vaes Posted: 08-14-2008 11:34

Hi,

Has anyone ever experimented with the RetrieveExchangeRate message for a plugin.
I need to change the way exchangerates are retrieved throughout the whole application.

When I browse google I can't find any topics concerning this type of plugin. The only thing that I can find is that it will have an input parameter called 'TransactionCurrencyId" and an outputparameter called "ExchaneRate".

The only problem is. When i register my plugin it does not contain an OutputParameter. When i manually add an outputparameter of type decimal i get an "Invalid cast exception".

I have tried:
context.OutputParameters.Properties.Add(new PropertyBagEntry("ExchangeRate", new CrmDecimal(new decimal(1.123456789))));

and
context.OutputParameters.Properties.Add(new PropertyBagEntry("ExchangeRate", new decimal(1.123456789)));

Any thoughts?

Note: The plugin has 2 steps registered in the Pre stage (Like the default Microsoft.Crm.ObjectModel steps)

Regards,

Kenny

http://kennyvaes.blogspot.com/
Not Ranked
Male
Posts 9
Points 90
Member since 05-30-2008

Another thought I just had was capturing the Retrieve message of the TransactionCurrency and putting the correct exchange rate in the Dynamic Entity.

This also does not work. It is NOT possible to capture the Retrieve message of the Transaction Currency entity. Crap!! :-)

http://kennyvaes.blogspot.com/
  • | Post Points: 5
Not Ranked
Male
Posts 9
Points 90
Member since 05-30-2008

I solved the issue.

I disabled the default plugins on the RetrieveExchangeRate message. This caused my problem i think.

What i did now is leave the default plugins enabled which caused me to have the OutputParameter and assign the property like so:
context.OutputParameters.Properties["ExchangeRate"] = (decimal) 1.123456789;

http://kennyvaes.blogspot.com/
  • | Post Points: 5
Page 1 of 1 (3 items) | RSS


Copyright Dynamics User Group, 1995-2009, all rights reserved. The Dynamics User Group is not affiliated with Microsoft Corporation.