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

Hi,

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).

Hi,

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

Pranav…

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

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

Hi,

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

Pranav…

main- AED,

sec-USD

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.