Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Request] Codeunit 8 AccSchedManagement - Procedure SetCFEntryFilters - OnAfterSetCFEntryFiltersAccShedLineCopyFilter #27853

Open
mavohra opened this issue Dec 27, 2024 · 0 comments
Labels
event-request Request for adding an event Finance GitHub request for Finance area

Comments

@mavohra
Copy link

mavohra commented Dec 27, 2024

Describe the request

Please add an event OnAfterSetCFEntryFiltersAccShedLineCopyFilter in procedure SetCFEntryFilters, immediately after the AccSchedLine.CopyFilter lines and before changing the CFForecastEntry.FilterGroup.

local procedure SetCFEntryFilters(var CFAccount: Record "Cash Flow Account"; var CFForecastEntry: Record "Cash Flow Forecast Entry"; var AccSchedLine: Record "Acc. Schedule Line"; var ColumnLayout: Record "Column Layout")
begin
    CFForecastEntry.SetCurrentKey(
        "Cash Flow Account No.", "Cash Flow Forecast No.", "Global Dimension 1 Code",
        "Global Dimension 2 Code", "Cash Flow Date");
    if CFAccount.Totaling = '' then
        CFForecastEntry.SetRange("Cash Flow Account No.", CFAccount."No.")
    else
        CFForecastEntry.SetFilter("Cash Flow Account No.", CFAccount.Totaling);
    CFAccount.CopyFilter("Date Filter", CFForecastEntry."Cash Flow Date");
    AccSchedLine.CopyFilter("Cash Flow Forecast Filter", CFForecastEntry."Cash Flow Forecast No.");
    AccSchedLine.CopyFilter("Dimension 1 Filter", CFForecastEntry."Global Dimension 1 Code");
    AccSchedLine.CopyFilter("Dimension 2 Filter", CFForecastEntry."Global Dimension 2 Code");

    OnAfterSetCFEntryFiltersAccShedLineCopyFilter(AccSchedLine, CFForecastEntry); // <--- New Event

    CFForecastEntry.FilterGroup(2);
    CFForecastEntry.SetFilter("Global Dimension 1 Code", AccSchedLine."Dimension 1 Totaling");
    CFForecastEntry.SetFilter("Global Dimension 2 Code", AccSchedLine."Dimension 2 Totaling");
    CFForecastEntry.FilterGroup(8);
    CFForecastEntry.SetFilter("Global Dimension 1 Code", GetDimTotalingFilter(1, ColumnLayout."Dimension 1 Totaling"));
    CFForecastEntry.SetFilter("Global Dimension 2 Code", GetDimTotalingFilter(2, ColumnLayout."Dimension 2 Totaling"));
    CFForecastEntry.FilterGroup(0);
end;

Integration Event Definition

[IntegrationEvent(false, false)]
local procedure OnAfterSetCFEntryFiltersAccShedLineCopyFilter(var AccSchedLine: Record "Acc. Schedule Line"; var CFForecastEntry: Record "Cash Flow Forecast Entry")
begin
end;

Additional context

This event is required to allow additional custom filters or processing logic to be applied after copying filters from the AccSchedLine to the CFForecastEntry

Event 2/3
Internal work item: AB#561477

@JesperSchulz JesperSchulz added event-request Request for adding an event Finance GitHub request for Finance area labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event Finance GitHub request for Finance area
Projects
None yet
Development

No branches or pull requests

2 participants