web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Exchange rate (Purchase Order)

(0) ShareShare
ReportReport
Posted on by 1,295

Hi guys,

I would like to seek help from you guys. I have questions:

1. PurchTable has Currency Code Field and I would like to ask if how to get the rate(in ExchangeRateCurrencyPair Table) but i have created a code: 

display VendExchRate dispExchangeRate()
{
ExchangeRate exchangeRate;
ExchangeRateCurrencyPair exchangeRateCurPair;
PurchTable purchTable;
PurchLine purchLine;
VendTable vendTable;


//Select query - Purch Table

select * from vendTable join exchangeRateCurPair where this.Currency == exchangeRateCurPair.FromCurrencyCode;

//Select query - Exchange Rate Currency Pair

select * from exchangeRate where exchangeRate.RecId == exchangeRateCurPair.RecId ;


return exchangeRate.ExchangeRate;
}

2. 

The currency CNY -MYR conversion has 2 data which displays valid exchange rates for the date range how to display according date range?

Hoping for your fast Response.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Consider utilizing following class

    ExchangeRateHelper

    This class is having all the methods to find out the exchange rate value.

    Please verify and update us if this is helpful

  • SII1MNL Profile Picture
    1,295 on at

    So i can place it in SSRS report? To get the result, according from what date? Because I am creating a report and i need to display the rate of each currency code according from what date it was created.

  • Verified answer
    Community Member Profile Picture
    on at

    you can use this class in your SSRS reports RDP class.

    A RDP class of a SSRS report basically populates a temp table which is basically a data set to a table.

    so in reports temp table create a field for exchange rate and populate the field using ExchangeRateHelper class

    Please verify and update us if this information helps you.

  • SII1MNL Profile Picture
    1,295 on at

    purchOrderHistoryTmp.OrderAccount   = purchTable.OrderAccount;

    purchOrderHistoryTmp.PurchName      = purchTable.PurchName;

    purchOrderHistoryTmp.CurrencyCode   = purchTable.CurrencyCode;

    purchOrderHistoryTmp.LineAmount     = purchTable.amountInvoicedExclTax();

    "purchOrderHistoryTmp.ExchangeRate   = exchangeRateHelper.getExchangeRate1();"

    I add this "purchOrderHistoryTmp.ExchangeRate   = exchangeRateHelper.getExchangeRate1();" in my RDP class  and I want to connect it based from currency code in PurchTable. I don't know if it's right.

  • Community Member Profile Picture
    on at

    As per my understanding you are on right track.

    Please validated that this method exchangeRateHelper.getExchangeRate1() is returning your expected value.

  • SII1MNL Profile Picture
    1,295 on at

    12.gif

    "Please validate that this method exchangeRateHelper.getExchangeRate1 () is returning your expected value. "

    -I run my report and it throws an error. 

    I have 2 currency code here. Hope you can help me with this. I'm new to this. 

  • Verified answer
    SII1MNL Profile Picture
    1,295 on at

    I solved my problem on how to get the exchange rate based on the currency given on start date in Exchange Rate Table.

    To get the exchange rate base on currency in PurchTable:

    "ExchangeRateHelper::getExchangeRate1_Static(Ledger::current(),purchTable.CurrencyCode,today());"

    Thank you nitesh Ranjan also for the help and giving me the idea. :)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans