[Event Request] Codeunit 7312 "Create Pick".CreateTempLine
Could we please have an Event including eventhandler in Codeunit 7312 in function CreateTempLine?
Code example:
begin
TotalQtyPickedBase := 0;
GetLocation(LocationCode);
// start kvspsa - Event Raiser
SkipReservation := false;
isHandled := false;
**OnBeforeCreateTempLineCheckReservation(SourceType, SourceNo, SourceLineNo, QtyBaseMaxAvailToPick, SkipReservation, isHandled);**
if not IsHandled or not SkipReservation then begin
// stop kvspsa
if Location."Directed Put-away and Pick" then
QtyBaseMaxAvailToPick := // Total qty (excl. Receive bin content) that are not assigned to any activity/ order
CalcTotalQtyOnBinType('', LocationCode, ItemNo, VariantCode) -
CalcTotalQtyAssgndOnWhse(LocationCode, ItemNo, VariantCode) +
CalcTotalQtyAssgndOnWhseAct(TempWhseActivLine."Activity Type"::"Put-away", LocationCode, ItemNo, VariantCode) -
CalcTotalQtyOnBinType(GetBinTypeFilter(0), LocationCode, ItemNo, VariantCode) // Receive area
else
QtyBaseMaxAvailToPick :=
CalcAvailableQty(ItemNo, VariantCode) -
CalcPickQtyAssigned(LocationCode, ItemNo, VariantCode, UnitofMeasureCode, FromBinCode, TempWhseItemTrackingLine);
CheckReservation(
QtyBaseMaxAvailToPick, SourceType, SourceSubType, SourceNo, SourceLineNo, SourceSubLineNo, Location."Always Create Pick Line",
QtyPerUnitofMeasure, TotalQtytoPick, TotalQtytoPickBase);
// start kvspsa - Code Modification
end;
// stop kvspsa
Thank you
Why do you need parameter SkipReservation? Can we use IsHandled only?
Yep. IsHandled should be enought if your implementation follows our example. The skipreservation was a leftover from our upgrade. sorry.
Fixed Code Example (Create Pick.Codeunit.al):
procedure CreateTempLine(LocationCode: Code[10]; ItemNo: Code[20]; VariantCode: Code[10]; UnitofMeasureCode: Code[10]; FromBinCode: Code[20]; ToBinCode: Code[20]; QtyPerUnitofMeasure: Decimal; var TotalQtytoPick: Decimal; var TotalQtytoPickBase: Decimal)
var
[...]
// start kvspsa - Variables added
isHandled: Boolean;
// stop kvspsa
begin
TotalQtyPickedBase := 0;
GetLocation(LocationCode);
// start kvspsa - Event Raiser
isHandled := false;
OnBeforeCreateTempLineCheckReservation(SourceType, SourceNo, SourceLineNo, QtyBaseMaxAvailToPick, isHandled);
if not IsHandled then begin
// stop kvspsa
if Location."Directed Put-away and Pick" then
QtyBaseMaxAvailToPick := // Total qty (excl. Receive bin content) that are not assigned to any activity/ order
CalcTotalQtyOnBinType('', LocationCode, ItemNo, VariantCode) -
CalcTotalQtyAssgndOnWhse(LocationCode, ItemNo, VariantCode) +
CalcTotalQtyAssgndOnWhseAct(TempWhseActivLine."Activity Type"::"Put-away", LocationCode, ItemNo, VariantCode) -
CalcTotalQtyOnBinType(GetBinTypeFilter(0), LocationCode, ItemNo, VariantCode) // Receive area
else
QtyBaseMaxAvailToPick :=
CalcAvailableQty(ItemNo, VariantCode) -
CalcPickQtyAssigned(LocationCode, ItemNo, VariantCode, UnitofMeasureCode, FromBinCode, TempWhseItemTrackingLine);
CheckReservation(
QtyBaseMaxAvailToPick, SourceType, SourceSubType, SourceNo, SourceLineNo, SourceSubLineNo, Location."Always Create Pick Line",
QtyPerUnitofMeasure, TotalQtytoPick, TotalQtytoPickBase);
// start kvspsa - Code Modification
end;
// stop kvspsa
[...]
// start kvspsa - Event Publisher
[IntegrationEvent(false, false)]
local procedure OnBeforeCreateTempLineCheckReservation(SourceType: Integer; SourceNo: Code[20]; SourceLineNo: Integer; var QtyBaseMaxAvailToPick: Decimal; var isHandled: Boolean);
begin
end;
// stop kvspsa
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.
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.
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.