[ES][Table][8063][Vendor Subscription Contract] Add OnBeforeConfirmUpdateAllLineDim event
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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