Comments
Proposed code is marked as //K3 New
codeunit 77000 "K3Whse.-Act.-Register (Yes/No)"
{
TableNo = "Warehouse Activity Line";
trigger OnRun()
begin
WhseActivLine.Copy(Rec);
Code;
Copy(WhseActivLine);
end;
var
Text001: Label 'Do you want to register the %1 Document?';
WhseActivLine: Record "Warehouse Activity Line";
WhseActivityRegister: Codeunit "Whse.-Activity-Register";
WMSMgt: Codeunit "WMS Management";
Text002: Label 'The document %1 is not supported.';
Handled: Boolean; //K3 New +-
local procedure "Code"()
begin
OnBeforeCode(WhseActivLine);
with WhseActivLine do begin
if ("Activity Type" = "Activity Type"::"Invt. Movement") and
not ("Source Document" in ["Source Document"::" ",
"Source Document"::"Prod. Consumption",
"Source Document"::"Assembly Consumption"])
then
Error(Text002, "Source Document");
WMSMgt.CheckBalanceQtyToHandle(WhseActivLine);
if not Confirm(Text001, false, "Activity Type") then
exit;
//K3 New -
OnBeforeRegister(WhseActivLine, Handled);
If not Handled then begin
//K3 New +
WhseActivityRegister.Run(WhseActivLine);
Clear(WhseActivityRegister);
end; //K3 New +-
end;
OnAfterCode(WhseActivLine);
end;
[IntegrationEvent(false, false)]
local procedure OnAfterCode(var WarehouseActivityLine: Record "Warehouse Activity Line")
begin
end;
//K3 New -
[IntegrationEvent(false, false)]
local procedure OnBeforeRegister(var WarehouseActivityLine: Record "Warehouse Activity Line"; Var Handled: Boolean)
begin
end;
//K3 New +
}
Category: Development
Business Central Team (administrator)
Business Central Team