[Event Request] codeunit 905 "Assembly Line Management" - Hide warning
Why do you need this change?
We have a custom process that creates, expload BOM, releases, and posts several Assembly Orders in one shot, and in case there is some due date difference, the customer sees a lot of messages that block UI.
Describe the request
Please add an event that will allow us to handle - ShowDueDateBeforeWorkDateMsg. I know that there is SetWarningsOn function, but there are cases, when we just run whole CU for release AO, and we cannot set it Internal work item: AB#582282
The OnRun function is empty in the codeunit, so you cannot use Codeunit.Run("Assembly Line Management") but have to declare a variable and call specific methods. You should be able to use SetWarningsOn as well.
@alexei-dobriansky, sorry, I wrongly described the process Modification that we have: during the release Assembly (OnBeforeReleaseAssemblyDoc) we do automatic ExplodeBOM
procedure ExplodeBOM(var AssemblyHeader: Record "Assembly Header")
var
AssemblyLine: Record "Assembly Line";
FromBOMComp: Record "BOM Component";
AssemblyLineManagement: Codeunit "Assembly Line Management";
begin
AssemblyLine.SetRange("Document No.", AssemblyHeader."No.");
AssemblyLine.SetRange("Document Type", "Assembly Document Type"::Order);
AssemblyLine.SetFilter(Type, '<>%1', "BOM Component Type"::" ");
if AssemblyLine.FindSet(true) then
repeat
CheckLocationCodeAsmLine(AssemblyLine);
FromBOMComp.SetRange("Parent Item No.", AssemblyLine."No.");
if not FromBOMComp.IsEmpty() then begin
CancelReserveBOMItem(AssemblyLine);
if not InstructionMgt.IsEnabled(ShowDueDateBeforeWorkDateWarning()) then
AssemblyLineManagement.SetWarningsOff();
AssemblyLineManagement.ExplodeAsmList(AssemblyLine);
end;
until AssemblyLine.Next() = 0;
end;
But in ExplodeAsmList there is part that cannot be skipped
OnExplodeAsmListOnAfterToAssemblyLineModify(TempAssemblyLine, ToAssemblyLine);
while TempAssemblyLine.Next() <> 0 do begin
ToAssemblyLine := TempAssemblyLine;
ToAssemblyLine.Insert();
OnExplodeAsmListOnAfterToAssemblyLineInsert(TempAssemblyLine, ToAssemblyLine);
if ToAssemblyLine."Due Date" < WorkDate() then begin
DueDateBeforeWorkDate := true;
NewLineDueDate := ToAssemblyLine."Due Date";
end;
end;
if DueDateBeforeWorkDate then
ShowDueDateBeforeWorkDateMsg(NewLineDueDate);
and because of this part
if ToAssemblyLine."Due Date" < WorkDate() then begin
DueDateBeforeWorkDate := true;
NewLineDueDate := ToAssemblyLine."Due Date";
end;
User see a lot of messages
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. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: 36603.