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
Hello,
please extend UpdateShptLinesOnInv and add an event with ishandled-pattern before the testfields.
There is some similar function in Codeunit Purch.-Post for procudure PostItemTrackingForReceipt with procedure CheckPurchRcptLine.
local procedure UpdateShptLinesOnInv(var ServiceLine: Record "Service Line"; var RemQtyToBeInvoiced: Decimal; var RemQtyToBeInvoicedBase: Decimal; var RemQtyToBeConsumed: Decimal; var RemQtyToBeConsumedBase: Decimal)
var
ServiceShptLine: Record "Service Shipment Line";
ItemEntryRelation: Record "Item Entry Relation";
QtyToBeInvoiced: Decimal;
QtyToBeInvoicedBase: Decimal;
QtyToBeConsumed: Decimal;
QtyToBeConsumedBase: Decimal;
EndLoop: Boolean;
// NEW >>
IsHandled: Boolean;
// NEW <<
begin
EndLoop := false;
if ((Abs(RemQtyToBeInvoiced) > Abs(ServiceLine."Qty. to Ship")) and Invoice) or
((Abs(RemQtyToBeConsumed) > Abs(ServiceLine."Qty. to Ship")) and Consume)
then begin
ServiceShptLine.Reset();
case ServHeader."Document Type" of
ServHeader."Document Type"::Order:
begin
ServiceShptLine.SetCurrentKey("Order No.", "Order Line No.");
ServiceShptLine.SetRange("Order No.", ServiceLine."Document No.");
ServiceShptLine.SetRange("Order Line No.", ServiceLine."Line No.");
end;
ServHeader."Document Type"::Invoice:
begin
ServiceShptLine.SetRange("Document No.", ServiceLine."Shipment No.");
ServiceShptLine.SetRange("Line No.", ServiceLine."Shipment Line No.");
end;
end;
ServiceShptLine.SetFilter("Qty. Shipped Not Invoiced", '<>0');
if ServiceShptLine.Find('-') then begin
ServPostingJnlsMgt.SetItemJnlRollRndg(true);
repeat
if TrackingSpecificationExists then begin
ItemEntryRelation.Get(TempInvoicingSpecification."Item Ledger Entry No.");
ServiceShptLine.Get(ItemEntryRelation."Source ID", ItemEntryRelation."Source Ref. No.");
end else
ItemEntryRelation."Item Entry No." := ServiceShptLine."Item Shpt. Entry No.";
// NEW >>
IsHandled := false;
OnUpdateShptLineOnInvOnBeforeTestServiceShptLine(ServiceShptLine, ServiceLine, IsHandled);
if not IsHandled then begin
// NEW <<<
ServiceShptLine.TestField("Customer No.", ServiceLine."Customer No.");
ServiceShptLine.TestField(Type, ServiceLine.Type);
ServiceShptLine.TestField("No.", ServiceLine."No.");
ServiceShptLine.TestField("Gen. Bus. Posting Group", ServiceLine."Gen. Bus. Posting Group");
ServiceShptLine.TestField("Gen. Prod. Posting Group", ServiceLine."Gen. Prod. Posting Group");
ServiceShptLine.TestField("Unit of Measure Code", ServiceLine."Unit of Measure Code");
ServiceShptLine.TestField("Variant Code", ServiceLine."Variant Code");
// NEW >>
end;
// NEW <<
if -ServiceLine."Qty. to Invoice" * ServiceShptLine.Quantity < 0 then
ServiceLine.FieldError("Qty. to Invoice", Text011);
// ...
Event definition
[IntegrationEvent(false, false)]
local procedure OnUpdateShptLineOnInvOnBeforeTestServiceShptLine(var ServiceShipmentLine: Record "Service Shipment Line"; ServiceLine: Record "Service Line"; var IsHandled: Boolean)
begin
end;
Thanks in advance!
Regards
Additional context
We have some scenarios, in which we want to test for additional and other fields/values while posting.
The text was updated successfully, but these errors were encountered:
ISliceUrPanties
changed the title
[Event Request] Codeunit 5988 - UpdateShptLinesOnInv
[Event Request] Codeunit 5988 "Serv-Documents Mgt." - UpdateShptLinesOnInv
Feb 19, 2025
Describe the request
Hello,
please extend UpdateShptLinesOnInv and add an event with ishandled-pattern before the testfields.
There is some similar function in Codeunit Purch.-Post for procudure PostItemTrackingForReceipt with procedure CheckPurchRcptLine.
Event definition
Thanks in advance!
Regards
Additional context
We have some scenarios, in which we want to test for additional and other fields/values while posting.
The text was updated successfully, but these errors were encountered: