Skip to content

[W1][Codeunit][1281][Update Currency Exchange Rates] OnBeforeSyncCurrencyExchangeRates event #29131

Description

@polina-se

Why do you need this change?

Dear Microsoft Team,
I would like to request the addition of a new event, OnBeforeSyncCurrencyExchangeRates, in codeunit 1281 'Update Currency Exchange Rates'.
This event is required to prevent errors if the 'Update Currency Exchange Rates' codeunit is used in the Job queue.
Currency Exchange Rate Update Job Queue Entry stops updating rates for a few sources in case one of the services has an error. The error is not recorded in the Job Queue Entry Log.
Thank you for considering this request.

Describe the request

This change is needed in BC25.
Proposed Event Code:

[W1][Codeunit][1281][Update Currency Exchange Rates] OnBeforeSyncCurrencyExchangeRates()
___
This event is necessary to prevent errors if the 'Update Currency Exchange Rates' codeunit is used in the Job queue. Currency Exchange Rate Update Job Queue Entry stops updating rates for a few sources in case one of the services has an error.
___
[IntegrationEvent(false, false)]local procedure OnBeforeSyncCurrencyExchangeRates(var CurrExchRateUpdateSetup: Record "Curr. Exch. Rate Update Setup"; var ResponseInStream: InStream; var SourceName: Text; var IsHandled: Boolean)
begin
end;

Proposed Event Placement:

local procedure SyncCurrencyExchangeRates()
    ...
begin
    IsHandled := false;
    OnBeforeSyncCurrencyExchangeRates(CurrExchRateUpdateSetup, ResponseInStream, SourceName, IsHandled);
    if IsHandled then
       exit;

    CurrExchRateUpdateSetup.SetRange(Enabled, true);
    ...
end;

Internal work item: AB#599970

Metadata

Metadata

Assignees

No one assigned

    Labels

    FinanceGitHub request for Finance areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions