[EventRequest] Codeunit 22 - ApplyItemLedgEntry
Hello,
we have a logic where we would like to apply an item ledger entry independent the following condition in function ApplyItemLedgEntry(...). Right now you can only add conditions to skip applying, but cannot add conditions to do the applying.
if (ItemLedgEntry."Remaining Quantity" = 0) or
(ItemLedgEntry."Drop Shipment" and (ItemLedgEntry."Applies-to Entry" = 0)) or
((Item."Costing Method" = Item."Costing Method"::Specific) and ItemLedgEntry.Positive) or
(ItemJnlLine."Direct Transfer" and (ItemLedgEntry."Location Code" = '') and ItemLedgEntry.Positive)
then
exit;
Is it possible to get a handled-pattern here, so that we can decide wether we want to do the default check or not? The existing publisher "OnBeforeApplyItemLedgEntry(...)" does not help here, because we cant skip the check.
Hi Andreas,
Please provide the your vision of this event signature with needed set of parameters.
Rgds, Oleg.
Something like OnBeforeCheckApplyItemLedgEntry(var Handled: Boolean; var ItemLedgEntry: Record "Item Ledger Entry")
OnBeforeCheckApplyItemLedgEntry(Handled, ItemLedgerEntry, ItemJnlLine, CausedByTransfer);
if not Handled then
if (ItemLedgEntry."Remaining Quantity" = 0) or
(ItemLedgEntry."Drop Shipment" and (ItemLedgEntry."Applies-to Entry" = 0)) or
((Item."Costing Method" = Item."Costing Method"::Specific) and ItemLedgEntry.Positive) or
(ItemJnlLine."Direct Transfer" and (ItemLedgEntry."Location Code" = '') and ItemLedgEntry.Positive)
then
exit;
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.