[Event Change Request] table 38 "Purchase Header" - OnBeforeRecreatePurchLinesHandler
Hello, can you please move the OnBeforeRecreatePurchLinesHandler event before the PurchLineExists() check? We need this because we have an check for already registred purchase lines and give an error. An exit at this point ist not enough for us.
procedure RecreatePurchLines(ChangedFieldName: Text[100])
var
TempPurchLine: Record "Purchase Line" temporary;
ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
TempItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)" temporary;
TempInteger: Record "Integer" temporary;
TempPurchCommentLine: Record "Purch. Comment Line" temporary;
TransferExtendedText: Codeunit "Transfer Extended Text";
ConfirmManagement: Codeunit "Confirm Management";
ExtendedTextAdded: Boolean;
ConfirmText: Text;
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeRecreatePurchLinesHandler(Rec, xRec, ChangedFieldName, IsHandled);
if IsHandled then
exit;
if not PurchLinesExist() then
exit;
IsHandled := false;
OnRecreatePurchLinesOnBeforeConfirm(Rec, xRec, ChangedFieldName, HideValidationDialog, Confirmed, IsHandled);
if not IsHandled then
if GetHideValidationDialog() then
Confirmed := true
else begin
You could use the OnBeforeRecreatePurchLinesHandler event instead
I woud like to use the OnBeforeRecreatePurchLinesHandler event. but befor run the PurchLinesExist() precedure.
Sorry, I mis-read your post. I understand now and yes moving it to the beginning of the procedure would be needed for your requirement.
This is possibly a breaking change. Some apps could depend on the previous exit from PurchLinesExists().
This request should be new event (e.g. OnRecreatePurchLinesOnBeforePurchLinesExists)
Already implemented