[Event Request] codeunit 7312 "Create Pick" OnCreateWhseDocTakeLineBeforeRemoveZoneCodeFilter
Hello,
Is it possible to add the following Event:
local procedure CreateWhseDocTakeLine(var WhseActivLine: Record "Warehouse Activity Line"; var LineNo: Integer) var WhseActivLine2: Record "Warehouse Activity Line"; TempWhseActivLine2: Record "Warehouse Activity Line" temporary; WhseActivLine3: Record "Warehouse Activity Line"; IsHandled: Boolean; begin TempWhseActivLine2.Copy(TempWhseActivLine); TempWhseActivLine.SetCurrentKey( "Whse. Document No.", "Whse. Document Type", "Activity Type", "Whse. Document Line No.", "Action Type"); TempWhseActivLine.Delete();
TempWhseActivLine.SetRange("Whse. Document Type", TempWhseActivLine2."Whse. Document Type");
TempWhseActivLine.SetRange("Whse. Document No.", TempWhseActivLine2."Whse. Document No.");
TempWhseActivLine.SetRange("Activity Type", TempWhseActivLine2."Activity Type");
TempWhseActivLine.SetRange("Whse. Document Line No.", TempWhseActivLine2."Whse. Document Line No.");
TempWhseActivLine.SetRange("Action Type", TempWhseActivLine2."Action Type"::Take);
TempWhseActivLine.SetSourceFilter(
TempWhseActivLine2."Source Type", TempWhseActivLine2."Source Subtype", TempWhseActivLine2."Source No.",
TempWhseActivLine2."Source Line No.", TempWhseActivLine2."Source Subline No.", false);
TempWhseActivLine.SetRange("No.", TempWhseActivLine2."No.");
TempWhseActivLine.SetFilter("Line No.", '>%1', TempWhseActivLine2."Line No.");
TempWhseActivLine.SetRange("Bin Code", TempWhseActivLine2."Bin Code");
TempWhseActivLine.SetRange("Unit of Measure Code", WhseActivLine."Unit of Measure Code");
// DINNL <<
IsHandled := false;
OnCreateWhseDocTakeLineBeforeRemoveZoneCodeFilter(DINIsHandled);
if not IsHandled then
// DINNL >>
TempWhseActivLine.SetRange("Zone Code");
TempWhseActivLine.SetRange("Breakbulk No.", 0);
TempWhseActivLine.SetTrackingFilterFromWhseActivityLine(TempWhseActivLine2);
OnCreateWhseDocTakeLineOnAfterSetFilters(TempWhseActivLine, TempWhseActivLine2, WhseActivLine);
[IntegrationEvent(false, false)]
local procedure OnCreateWhseDocTakeLineBeforeRemoveZoneCodeFilter(var IsHandled: Boolean)
begin
end;
Is it ok for you to use existent event OnCreateWhseDocTakeLineOnAfterSetFilters to control filter by "Zone Code"?
Hi Oleg,
I don't see how, you are removing the Zone code filter on that spot. I dont know what the filter was in that event you suggest.
Hi Lee,
What about taking this filter from TempWhseActivLine2, which should store it due to:
begin
TempWhseActivLine2.Copy(TempWhseActivLine);
Ok, Agree, that should work. We are going to try that.
Thanks for thinking along :)