Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

CurrencyFactor by Document Date

(0) ShareShare
ReportReport
Posted on by 50

Hi, how to setup Currency Factor by Document Date. I have issue because Currency Factor only count the newest Exchange Rate. For example if i select Document Date at 01.07.2022, Currency Factor refuse to update, and stay at current day. I trying to set up this on Quotes. 

Any solutions?

  • Suggested answer
    Tony00001 Profile Picture
    Tony00001 50 on at
    RE: CurrencyFactor by Document Date

    I used EventSubscription:

    [EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnAfterValidateEvent', 'Document Date', false, false)]

       local procedure CallOnUpdateExchangeRate(CurrFieldNo: Integer; var Rec: Record "Purchase Header"; var xRec: Record "Purchase Header")

       begin

           if Rec."Currency Code" <> '' then

               Rec.UpdateCurrencyFactor();

           if Rec."Currency Factor" <> xRec."Currency Factor" then begin

               Rec.ConfirmCurrencyFactorUpdate();

           end;

       end;

       [EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnUpdateCurrencyFactorOnAfterCurrencyDateSet', '', false, false)]

       local procedure UpdateExchangeRate(CurrentFieldNo: Integer; var CurrencyDate: Date; var PurchaseHeader: Record "Purchase Header")

       begin

           CurrencyDate := PurchaseHeader."Document Date";

           CurrentFieldNo := PurchaseHeader.FieldNo("Document Date");

       end;

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans