Errror: Morphx Report(A currency to convert from is required to retrieve exchange rate information.)

I am opening a morphx report, i got following error:

“A currency to convert from is required to retrieve exchange rate information”.

In this report i want to retrive currency convert in invoice summary report.

Any kind of help is appreciated…

Please debug the code doing the conversion (which you haven’t shown), not the whole report. It seems that you’re not providing currency code from which an amount should be converted.

Also, please ask development-related questions in the developer forum. (Moved from the technical forum.)

Is the exchange rate present within the date of transaction?

ok

Yes , it is available.

Here Is the Code:

select * from _custPackingSlipTrans

where _custPackingSlipTrans.PackingSlipId == CustPackingSlipJour.PackingSlipId;

select * from _salesTable

where _salesTable.SalesId == _custPackingSlipTrans.OrigSalesId

&& _custPackingSlipTrans.PackingSlipId == CustPackingSlipJour.PackingSlipId;

_currencyCode = _salesTable.CurrencyCode;

transactiondate = CustPackingSlipJour.DeliveryDate;

exchangeRateHelper = ExchangeRateHelper::newExchangeDate(Ledger::current(), _currencyCode, transactiondate);

exchangeRate1 = exchangeRateHelper.getExchangeRate1();

exchangeRate = exchangeRateHelper.displayStoredExchangeRate(exchangeRate1);

finalExchangeRate = exchangeRate;

check this post…might be helpful!

http://dynamicsuser.net/forums/t/52661.aspx

I assume that the error is thrown by ExchangeRateHelper.validateFromCurrency() (called from getExchangeRate1()). This is something you can easily find in debugger, therefore it would be more efficient if you found it by yourself and passed to us.

The error is thrown if fromCurrency variable doesn’t have any value. You’re trying to set it from _currencyCode variable, therefore the assumption is that _currencyCode itself is empty. Again, use debugger to verify the assumption.

Martin Yes u r right.

wen i chk with debuger it show blank on From Currency.

but i assign it to get value from sales table.

here is part of code that i used to retrive from currency value:

CurrencyCode _currencyCode;

_currencyCode = _salesTable.CurrencyCode;

Again - don’t guess what’s happening, you can see it in debugger.

If _currencyCode is empty after getting value from _salesTable.CurrencyCode (which is another assumption you should verify), it must mean that _salesTable.CurrencyCode itself is empty.