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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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?

I have the same question (0)
  • Suggested answer
    Tony00001 Profile Picture
    50 on at

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans