regarding currency conversion..........


I am trying to convert currency for a report.

In report i have a field in dialog ,where u can enter date range along with currency.i am generating vendor report with in a date range and what ever amount it will print based on the currency input in dialog.

My code is working if the company currency is USD,but when the company currency is different it is not working.

return totalAmount * Exchrates::findExchRateDate(currencytmp,vendtrans.TransDate).ExchRate/100;

currencytmp = DIALOG INPUT.

i have written the code in display method of report ,while printing.

Can any body help me for this currency conversion(if the company currency is other than USD).


Have you tried to achieve through secondary currency which is basically used in reporting for additional currency.


for me secondary currency is USD,if i will use it ,it may work as i said u code work for USD.

Can u tell me what i need to write for use of secondary currency.


What have you setup as main currency and secondary cuerrency in GL parameter?


main- AED,


You need to check if the exchange rate is setup for the currency code that user select.

then use Currency::exchRate(tmpcurrencyCode,transdate) to find the exchange rate.