Skip to main content

Notifications

Announcements

No record found.

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

  • Verified answer
    SII1MNL Profile Picture
    SII1MNL 1,295 on at
    RE: Exchange rate (Purchase Order)

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

  • SII1MNL Profile Picture
    SII1MNL 1,295 on at
    RE: Exchange rate (Purchase Order)

    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. 

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Exchange rate (Purchase Order)

    As per my understanding you are on right track.

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

  • SII1MNL Profile Picture
    SII1MNL 1,295 on at
    RE: Exchange rate (Purchase Order)

    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.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Exchange rate (Purchase Order)

    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
    SII1MNL 1,295 on at
    RE: Exchange rate (Purchase Order)

    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
    Community Member Microsoft Employee on at
    RE: Exchange rate (Purchase Order)

    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans