Skip to content

[Event Request] New Publisher on codeunit 9200 "Matrix Management" procedure DimToCaptions #29536

@asanchezflbt

Description

@asanchezflbt

Why do you need this change?

We need this change so we can apply filters to de Dimension Values without using the filter field on the Budget Page

Describe the request

 procedure DimToCaptions(var CaptionSet: array[32] of Text[80]; var MatrixRecords: array[32] of Record "Dimension Code Buffer"; DimensionCode: Code[20]; FirstColumn: Text; LastColumn: Text; var NumberOfColumns: Integer; ShowColumnName: Boolean; var CaptionRange: Text; DimensionValueFilter: Text)
    var
        DimensionValue: Record "Dimension Value";
        i: Integer;
    begin
        DimensionValue.SetRange("Dimension Code", DimensionCode);
        DimensionValue.SetRange(Code, FirstColumn, LastColumn);
        DimensionValue.FilterGroup(7);
        if DimensionValueFilter <> '' then
            DimensionValue.SetFilter(Code, DimensionValueFilter);
        DimensionValue.FilterGroup(0);
        >>>>>>>>>>>>>>>>>>>>>>>>>>>
        OnAfterApplyFiltersDimensionValueOnBeforeFindSet(DimensionValue)
        <<<<<<<<<<<<<<<<<<<<<<<<<<<

        i := 0;
        if DimensionValue.FindSet() then
            repeat
                i := i + 1;
                MatrixRecords[i].Code := DimensionValue.Code;
                MatrixRecords[i].Name := DimensionValue.Name;
                MatrixRecords[i].Totaling := DimensionValue.Totaling;
                if ShowColumnName then
                    CaptionSet[i] := DimensionValue.Name
                else
                    CaptionSet[i] := DimensionValue.Code
            until (i = ArrayLen(CaptionSet)) or (DimensionValue.Next() = 0);

        NumberOfColumns := i;

        if NumberOfColumns > 1 then
            CaptionRange := CopyStr(CaptionSet[1] + '..' + CaptionSet[NumberOfColumns], 1, MaxStrLen(CaptionRange))
        else
            CaptionRange := CaptionSet[1];
    end;
    >>>>>>>>>>>>>>>>>>>>>>>>>
    [IntegrationEvent(false, false)]
    local procedure OnAfterApplyFiltersDimensionValueOnBeforeFindSet(var DimensionValue: Record "Dimension Value")
    begin
    end;
    <<<<<<<<<<<<<<<<<<<<<<<<<

Internal work item: AB#616775

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