Skip to content

[W1][MultiObjects] Codeunits 8364, 8365, 8367 Add integration event OnAfterPopulateLineBufferForReporting to filter Dimension Perspective sections before rendering #30327

Description

@bssirebsin

Why do you need this change?

Our ISV solution enforces per-entity data security, where an "entity" is a dimension value and a user may only see entities they're authorized for. When a financial report runs with a Dimension Perspective, sections for unauthorized entities must be omitted entirely from the output, not just blanked. This is a security requirement, so in-section filtering isn't sufficient.

No current extensibility point allows this. OnBeforeSaveDimPerspectiveReport fires per already-chosen line during iteration and can't remove a section (suppressing a line duplicates the prior section's output instead).

There's also no supported handle to the in-memory buffer BC iterates prior to render. The only working alternative is to delete/restore standard Dimension Perspective Line rows, which mutates shared standard data with a data-loss risk if the process fails mid-operation. Our current workaround is an inefficient and breakable disposable clone (tracking table & mid-op commit & cleanup) of the perspective. A single var event on the buffer would let us remove significant cloning logic and filter safely in memory instead.

Describe the request

Add an integration event at the end of PopulateLineBufferForReporting in each IDimensionPerspective implementation.
Codeunits 8364 DimPerspectiveBusinessUnit, 8365 DimPerspectiveCustom, and 8367 DimPerspectiveDimension.

These are firing after the buffer is populated, and we need the buffer by reference. Placing the event on the interface method (rather than in Report 25 or 29) secures both the PDF/print and Excel export paths with a single hook, since both reports call this method and iterate the returned buffer directly, and it covers all three perspective types since each builds the same buffer shape.

Because TempDimPerspectiveLine is a temporary record iterated directly by the caller, a var parameter is enough for us to implement our filtering.


// ... after the population loop, before the procedure returns
        OnAfterPopulateLineBufferForReporting(DimPerspectiveName, TempDimPerspectiveLine);
    end;

    [IntegrationEvent(false, false)]
    local procedure OnAfterPopulateLineBufferForReporting(DimPerspectiveName: Record "Dimension Perspective Name"; var TempDimPerspectiveLine: Record "Dimension Perspective Line")
    begin
    end;

Affected objects: interface IDimensionPerspective; codeunits 8364/8365/8367; reports 25 and 29; tables 8363/8364; enum 8363.
Target version: BC 28.3
Internal work item: AB#641549

Metadata

Metadata

Assignees

No one assigned

    Labels

    FinanceGitHub request for Finance areaevent-requestRequest for adding an event

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions