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))));
andcontext.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
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!! :-)
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;