You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
procedure CheckItemJnlLineFieldChange(ItemJnlLine: Record "Item Journal Line"; xItemJnlLine: Record "Item Journal Line"; CurrFieldCaption: Text[30])
var
BinContent: Record "Bin Content";
WhseItemJournal: Page "Whse. Item Journal";
WhsePhysInvtJournal: Page "Whse. Phys. Invt. Journal";
BinIsEligible: Boolean;
IsHandled: Boolean;
Cubage: Decimal;
Weight: Decimal;
begin
IsHandled := false;
OnBeforeCheckItemJnlLineFieldChange(ItemJnlLine, xItemJnlLine, CurrFieldCaption, IsHandled);
if IsHandled then
exit;
GetLocation(ItemJnlLine."Location Code");
OnCheckIfBinIsEligible(ItemJnlLine, BinIsEligible);
ShowError := CheckBinCodeChange(ItemJnlLine."Location Code", ItemJnlLine."Bin Code", xItemJnlLine."Bin Code") and not BinIsEligible;
if not ShowError then
ShowError := CheckBinCodeChange(ItemJnlLine."New Location Code", ItemJnlLine."New Bin Code", xItemJnlLine."New Bin Code");
//-----------------------------------------------------------OnCheckItemJnlLineFieldChangeOnAfterCheclBinCodeChange:BEGIN
OnCheckItemJnlLineFieldChangeOnAfterCheckBinCodeChange(ItemJnlLine, xItemJnlLine, CurrFieldCaption, ShowError, BinIsEligible)
//-----------------------------------------------------------OnCheckItemJnlLineFieldChangeOnAfterCheclBinCodeChange:END
if ShowError then
Error(Text015,
CurrFieldCaption,
LowerCase(Location.TableCaption()), Location.Code, Location.FieldCaption("Directed Put-away and Pick"));
if ItemJnlLine."Entry Type" in
[ItemJnlLine."Entry Type"::"Negative Adjmt.", ItemJnlLine."Entry Type"::"Positive Adjmt.", ItemJnlLine."Entry Type"::Sale, ItemJnlLine."Entry Type"::Purchase]
then begin
if (ItemJnlLine."Location Code" <> xItemJnlLine."Location Code") and (xItemJnlLine."Location Code" <> '') then begin
GetLocation(xItemJnlLine."Location Code");
ShowError := Location."Directed Put-away and Pick";
end;
if ((ItemJnlLine."Item No." <> xItemJnlLine."Item No.") and (xItemJnlLine."Item No." <> '')) or
((ItemJnlLine.Quantity <> xItemJnlLine.Quantity) and (xItemJnlLine.Quantity <> 0)) or
(ItemJnlLine."Variant Code" <> xItemJnlLine."Variant Code") or
(ItemJnlLine."Unit of Measure Code" <> xItemJnlLine."Unit of Measure Code") or
(ItemJnlLine."Entry Type" <> xItemJnlLine."Entry Type") or
(ItemJnlLine."Phys. Inventory" and
(ItemJnlLine."Qty. (Phys. Inventory)" <> xItemJnlLine."Qty. (Phys. Inventory)") or
(ItemJnlLine.Quantity <> xItemJnlLine.Quantity))
then begin
GetLocation(ItemJnlLine."Location Code");
ShowError := Location."Directed Put-away and Pick";
end;
//----------------------------------------------------------------------OnCheckItemJnlLineFieldChangeOnAfterAssignShowError:BEGIN
OnCheckItemJnlLineFieldChangeOnAfterAssignShowError(ItemJnlLine, xItemJnlLine, CurrFieldCaption, ShowError)
//----------------------------------------------------------------------OnCheckItemJnlLineFieldChangeOnAfterAssignShowError:END
if ShowError then begin
if ItemJnlLine."Phys. Inventory" then
Error(Text010,
CurrFieldCaption,
Location.TableCaption(), Location.Code, Location.FieldCaption("Directed Put-away and Pick"),
WhsePhysInvtJournal.Caption);
Error(Text010,
CurrFieldCaption,
Location.TableCaption(), Location.Code, Location.FieldCaption("Directed Put-away and Pick"),
WhseItemJournal.Caption);
end;
GetLocation(ItemJnlLine."Location Code");
if not Location."Bin Mandatory" then
exit;
if Location."Bin Capacity Policy" <> Location."Bin Capacity Policy"::"Never Check Capacity" then begin
if ItemJnlLine."Bin Code" <> '' then begin
CalcCubageAndWeight(ItemJnlLine."Item No.", ItemJnlLine."Unit of Measure Code", ItemJnlLine.Quantity, Cubage, Weight);
if BinContent.Get(Location.Code, ItemJnlLine."Bin Code", ItemJnlLine."Item No.", ItemJnlLine."Variant Code", ItemJnlLine."Unit of Measure Code") then
BinContent.CheckIncreaseBinContent(ItemJnlLine.Quantity, 0, 0, 0, Cubage, Weight, false, false)
else begin
GetBin(Location.Code, ItemJnlLine."Bin Code");
Bin.CheckIncreaseBin(Bin.Code, ItemJnlLine."Item No.", ItemJnlLine.Quantity, 0, 0, Cubage, Weight, false, false);
end;
end
end else
CheckWarehouseClass(Location.Code, ItemJnlLine."Bin Code", ItemJnlLine."Item No.", ItemJnlLine."Variant Code", ItemJnlLine."Unit of Measure Code");
end;
end;
//-----------------------------------------------------------OnCheckItemJnlLineFieldChangeOnAfterCheclBinCodeChange:BEGIN
[IntegrationEvent(true, false)]
local procedure OnCheckItemJnlLineFieldChangeOnAfterCheckBinCodeChange(var ItemJnlLine: Record "Item Journal Line"; var xItemJnlLine: Record "Item Journal Line"; CurrFieldCaption: Text[30]; var ShowError: Boolean; var BinIsEligible: Boolean)
begin
end;
//-----------------------------------------------------------OnCheckItemJnlLineFieldChangeOnAfterCheclBinCodeChange:END
//----------------------------------------------------------------------OnCheckItemJnlLineFieldChangeOnAfterAssignShowError:BEGIN
[IntegrationEvent(true, false)]
local procedure OnCheckItemJnlLineFieldChangeOnAfterAssignShowError(var ItemJnlLine: Record "Item Journal Line"; var xItemJnlLine: Record "Item Journal Line"; CurrFieldCaption: Text[30]; var ShowError: Boolean)
begin
end;
//----------------------------------------------------------------------OnCheckItemJnlLineFieldChangeOnAfterAssignShowError:END
Additional context
We need option change if error is show or not, because we do our different checks
Internal work item: AB#558859
The text was updated successfully, but these errors were encountered:
Describe the request
Please add new event
Additional context
We need option change if error is show or not, because we do our different checks
Internal work item: AB#558859
The text was updated successfully, but these errors were encountered: