microsoft / microsoft/BCApps

[ES][Table][8063][Vendor Subscription Contract] Add OnBeforeConfirmUpdateAllLineDim event

Open Beginner friendly
#10,800 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Approved event-request ext-ready-to-implement Team: Finance
Dominant language
AL
Stars
683
Forks
459
Avg merge
3d 26m
Merged PRs (30d)
633

Description

Why do you need this change?

I need an event similar to the one available in table "Customer Subscription Contract" so that whenever dimensions are updated on the Vendor Contract header, they are automatically updated on the related lines without prompting the user.

Describe the request

In table 8063 "Vendor Subscription Contract", within the UpdateAllLineDim function, I need an event to be published, OnBeforeConfirmUpdateAllLineDim(Rec, xRec, Confirmed, IsHandled), immediately before the call to ConfirmManagement.GetResponse(UpdateDimensionsOnLinesQst, true).

This event is required so that we can bypass the user confirmation dialog and always update the dimensions on the related contract lines automatically.

Therefore, the event should include both Confirmed and IsHandled parameters.

I need it to be identical to the implementation in the same UpdateAllLineDim function of table 8052 "Customer Subscription Contract", which I have included below.

local procedure UpdateAllLineDim(NewParentDimSetID: Integer; OldParentDimSetID: Integer)
var
ServiceCommitment: Record "Subscription Line";
NewDimSetID: Integer;
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeUpdateAllLineDim(Rec, NewParentDimSetID, OldParentDimSetID, IsHandled, xRec);
if IsHandled then
exit;

if NewParentDimSetID = OldParentDimSetID then
    exit;

OnBeforeConfirmUpdateAllLineDim(Rec, xRec, Confirmed, IsHandled);
if not IsHandled then
    if GetHideValidationDialog() or not GuiAllowed then
        Confirmed := true
    else
        Confirmed := ConfirmManagement.GetResponse(UpdateDimensionsOnLinesQst, true);
if not Confirmed then exit;

ServiceCommitment.Reset();
ServiceCommitment.SetRange("Subscription Contract No.", Rec."No.");
if ServiceCommitment.FindSet() then
    repeat
        NewDimSetID := DimMgt.GetDeltaDimSetID(ServiceCommitment."Dimension Set ID", NewParentDimSetID, OldParentDimSetID);
        if NewDimSetID <> ServiceCommitment."Dimension Set ID" then begin
            ServiceCommitment."Dimension Set ID" := NewDimSetID;
            DimMgt.UpdateGlobalDimFromDimSetID(
             ServiceCommitment."Dimension Set ID", ServiceCommitment."Shortcut Dimension 1 Code", ServiceCommitment."Shortcut Dimension 2 Code");
            ServiceCommitment.Modify(false);
            ServiceCommitment.UpdateRelatedVendorServiceCommDimensions(OldParentDimSetID, ServiceCommitment."Dimension Set ID");
        end;
    until ServiceCommitment.Next() = 0;

end;

Provide an implementation (optional)
  • I will provide the implementation for this extensibility request

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in table 8063 "Vendor Subscription Contract" at the UpdateAllLineDim function, then compare its confirmation flow with the implementation in table 8052 "Customer Subscription Contract". Add the requested event with Rec, xRec, Confirmed, and IsHandled immediately before the confirmation call, and ensure the event can bypass the prompt while preserving the existing update behavior.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.