hi all,
i write below code for testing purpose to get exchange rate for sales order line
Gl - setup

public display Amount GDJ_ExchangeRate()
{
ExchangeRate exchangeRate;
ExchangeRateType ExchangeRateType;
ExchangeRateCurrencyPair exchangeRateCurrencyPair;
real exchRate;
CurrencyCode fromCurrency = 'USD';
CurrencyCode toCurrency = Ledger::find(Ledger::current()).AccountingCurrency ;
TransDate transDate = mkDate(7,8,2020);//this.TransDate;
while select exchangeRateCurrencyPair
where exchangeRateCurrencyPair.ExchangeRateType == Ledger::find(Ledger::current()).DefaultExchangeRateType
&& exchangeRateCurrencyPair.FromCurrencyCode == fromCurrency
&& exchangeRateCurrencyPair.ToCurrencyCode == toCurrency
{
exchRate = exchangeRate::findByDate(exchangeRateCurrencyPair.RecId,transDate).ExchangeRate;
info(strFmt("%1",exchRate/100));
}
return exchRate/100;
}
i debugged the above code
form Currency- USD
to Currency = JPY
transdate = mkdate();
while select exchangeRateCurrencyPair
where exchangeRateCurrencyPair.ExchangeRateType == Ledger::find(Ledger::current()).DefaultExchangeRateType
***here i am getting ReciD = 0, if i am not wrong , it should be return Standard
please help me