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] table 38 "Purchase Header" OnValidateShortcutDimCodeOnBeforeUpdateUpdateAllLineDim #26575

Open
auzhhv opened this issue May 30, 2024 · 0 comments
Labels
event-request Request for adding an event Finance GitHub request for Finance area

Comments

@auzhhv
Copy link
Contributor

auzhhv commented May 30, 2024

Describe the request

Can you add event after it checks whether a change has been made?

    procedure ValidateShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])
    var
        OldDimSetID: Integer;
    begin
        OnBeforeValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode);

        OldDimSetID := "Dimension Set ID";
        DimMgt.ValidateShortcutDimValues(FieldNumber, ShortcutDimCode, "Dimension Set ID");
        if "No." <> '' then
            Modify();

        if OldDimSetID <> "Dimension Set ID" then begin
            // >>>>>>>>>>>>>>>>>>
            OnValidateShortcutDimCodeOnBeforeUpdateUpdateAllLineDim(Rec, xRec); //Rec as reference
            // <<<<<<<<<<<<<<<<<<
            if not IsNullGuid(Rec.SystemId) then
                Modify();
            if PurchLinesExist() then
                UpdateAllLineDim("Dimension Set ID", OldDimSetID);
        end;

        OnAfterValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode);
    end;

Additional context

I'm going to update other dimensions when some dimensions had been updated.
To be able to make UpdateAllLineDim work OldDimSetID must be the dimension set id before i change it.
Otherwise only the dimension updated by BC will be updated to the lines.
Internal work item: AB#536970

@AndersLarsenMicrosoft AndersLarsenMicrosoft added event-request Request for adding an event Finance GitHub request for Finance area labels May 30, 2024
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