Reputation: 41
I have created a new Exchange provider according to the Manual in the Microsoft Page but when I try to import the data's it shows nothing,no errors and doesn't make the import of the data.I try to debug but I get nowhere. Any suggestion? Thank you
Upvotes: 0
Views: 755
Reputation: 5117
I'm guessing that you are referring to the Creating Exchange Rate Providers for Microsoft Dynamics AX 2012 white paper.
Following the instructions in the white paper, I encountered the following problems:
getExchangeRates
method contains a try-catch
block that swallows all exceptions silently, including the exceptions from the following problems.getExchangeRates
method contains a hidden* TODO to replace part of a commented code line with the API key that you receive when you register with Oanda (see chapter "Before you begin" in the white paper or OANDA Exchange Rates API). After replacing the part with your API key, the line must be un-commented, of course.rateEnumerator
variable in the getExchangeRates
method, no moveNext()
is made, which causes the subsequent current()
call to fail.if
statement in method readRate
, exchangeRate
should be replaced with exchangeDate
.After resolving these issues and doing an incremental CIL compilation, I was able to import exchange rates.
Regarding debugging: the code of the new exchange rate provider is run in CIL, so you need Visual Studio to debug the code (see Walkthrough: Using the Debug Properties When Debugging Managed Code (AX 2012)). You can also set a breakpoint in class SysOperationServiceController
, method run
and then force the code to execute not in CIL using the "Set Next Statement" function in the debugger to execute the this.runOperation(false);
statement.
*hidden because it does not appear as a task in the compiler window
Upvotes: 1