[Event Request] codeunit 5912 "ServLedgEntries-Post" - multiple publishers
Hello, would it be possible to add OnBeforeInsertServLedgerEntry, OnBeforeInsertServLedgerEntrySale, OnBeforeInsertServLedgEntryCrMemo events to codeunit 5912 "ServLedgEntries-Post", like this:
local procedure InsertServLedgerEntryCrMUsage(var NextEntryNo: Integer; var ServHeader: Record "Service Header"; var ServLine: Record "Service Line"; DocNo: Code[20])
...
LineAmount: Decimal;
Result: Integer;
IsHandled: Boolean;
begin
> OnBeforeInsertServLedgerEntry(NextEntryNo, ServHeader, TempServLine, ServItemLine, Qty, DocNo, Result, IsHandled);//New Event
if IsHandled then
exit(Result);
ServLedgEntry.LockTable();
procedure InsertServLedgerEntrySale(var PassedNextEntryNo: Integer; var ServHeader: Record "Service Header"; var ServLine: Record "Service Line"; var ServItemLine: Record "Service Item Line"; Qty: Decimal; QtyToCharge: Decimal; GenJnlLineDocNo: Code[20]; DocLineNo: Integer)
...
CurrExchRate: Record "Currency Exchange Rate";
TotalAmount: Decimal;
IsHandled: Boolean;
begin
> OnBeforeInsertServLedgerEntrySale(PassedNextEntryNo, ServHeader, ServLine, ServItemLine, ServLedgEntry, Qty, QtyToCharge, GenJnlLineDocNo, DocLineNo, IsHandled);//New Event
if IsHandled then
exit;
if (ServLine."Document No." = '') and
local procedure InsertServLedgEntryCrMemo(var PassedNextEntryNo: Integer; var ServHeader: Record "Service Header"; var ServLine: Record "Service Line"; GenJnlLineDocNo: Code[20])
...
ServItem: Record "Service Item";
TotalAmount: Decimal;
IsHandled: Boolean;
begin
> OnBeforeInsertServLedgEntryCrMemo(PassedNextEntryNo, ServHeader, ServLine, GenJnlLineDocNo, IsHandled);//New Event
if IsHandled then
exit;
if ServLine."Qty. to Invoice" = 0 then
exit;
[IntegrationEvent(false, false)]
local procedure OnBeforeInsertServLedgerEntry(var NextEntryNo: Integer; var ServHeader: Record "Service Header"; var TempServLine: Record "Service Line"; var ServItemLine: Record "Service Item Line"; Qty: Decimal; DocNo: Code[20]; var Result: Integer; var IsHandled: Boolean)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeInsertServLedgerEntrySale(var PassedNextEntryNo: Integer; var ServHeader: Record "Service Header"; var ServLine: Record "Service Line"; var ServItemLine: Record "Service Item Line"; var ServLedgEntry: Record "Service Ledger Entry"; Qty: Decimal; QtyToCharge: Decimal; GenJnlLineDocNo: Code[20]; DocLineNo: Integer; var IsHandled: Boolean)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeInsertServLedgEntryCrMemo(var PassedNextEntryNo: Integer; var ServHeader: Record "Service Header"; var ServLine: Record "Service Line"; GenJnlLineDocNo: Code[20]; var IsHandled: Boolean)
begin
end;
Please explain why do you want to ignore insert of service ledger entries? It will break basic functionality in Service Management module.
Hello, since Service Ledger entries are posted directly without journals, a custom journal was created to match standard journals like Item Journal, G/L journal, FA Journal. For this purpose, 3 new publishers are required in each procedure's beginning.
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.
Build ID: 11137.