ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Table 38 - Purchase Header - UpdateAllLineDim

Open almatlansag opened this issue 6 years ago • 2 comments

Could you please create the following Integration event in Table 38 "Purchase Header", in function UpdateAllLineDim?

[External] UpdateAllLineDim(NewParentDimSetID : Integer;OldParentDimSetID : Integer)
IsHandled := FALSE;
OnBeforeUpdateAllLineDim(Rec,NewParentDimSetID,OldParentDimSetID,IsHandled);
IF IsHandled THEN
  EXIT;

IF NewParentDimSetID = OldParentDimSetID THEN
  EXIT;
IF NOT ConfirmManagement.ConfirmProcess(Text051,TRUE) THEN
  EXIT;

PurchLine.RESET;
PurchLine.SETRANGE("Document Type","Document Type");
PurchLine.SETRANGE("Document No.","No.");
PurchLine.LOCKTABLE;
IF PurchLine.FIND('-') THEN
  REPEAT
    NewDimSetID := DimMgt.GetDeltaDimSetID(PurchLine."Dimension Set ID",NewParentDimSetID,OldParentDimSetID);
    // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    OnUpdateAllLineDimOnAfterGetDeltaDimSetID(Rec,xRec,PurchLine,NewDimSetID,NewParentDimSetID,OldParentDimSetID);
    // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    IF PurchLine."Dimension Set ID" <> NewDimSetID THEN BEGIN
      PurchLine."Dimension Set ID" := NewDimSetID;

      IF NOT GetHideValidationDialog AND GUIALLOWED THEN
        VerifyReceivedShippedItemLineDimChange(ReceivedShippedItemLineDimChangeConfirmed);

      DimMgt.UpdateGlobalDimFromDimSetID(
        PurchLine."Dimension Set ID",PurchLine."Shortcut Dimension 1 Code",PurchLine."Shortcut Dimension 2 Code");

      OnUpdateAllLineDimOnBeforePurchLineModify(PurchLine);
      PurchLine.MODIFY;
    END;
  UNTIL PurchLine.NEXT = 0;

Event signature:

LOCAL [IntegrationEvent] OnUpdateAllLineDimOnAfterGetDeltaDimSetID(VAR PurchaseHeader : Record "Purchase Header";xPurchaseHeader : Record "Purchase Header";VAR PurchaseLine : Record "Purchase Line";VAR NewDimSetID : Integer;NewParentDimSetID : Integer;OldParentDimSetID : Integer)

almatlansag avatar Mar 18 '20 12:03 almatlansag

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.

bc-ghost avatar Mar 24 '20 07:03 bc-ghost

Hello colleagues,

The event was confirmed, but it is still missing in latest CU https://bcartifacts.azureedge.net/onprem/16.5.15897.15953/de

PurchaseHeader.Table.al:3748

                OnUpdateAllLineDimOnBeforeGetPurchLineNewDimsetID(PurchLine, NewParentDimSetID, OldParentDimSetID);
                NewDimSetID := DimMgt.GetDeltaDimSetID(PurchLine."Dimension Set ID", NewParentDimSetID, OldParentDimSetID);
                if PurchLine."Dimension Set ID" <> NewDimSetID then begin
                    PurchLine."Dimension Set ID" := NewDimSetID;

Could you check why, please?

Mike-1984 avatar Sep 23 '20 16:09 Mike-1984