[Event Request] Table 81 - Gen. Journal Line - SetJournalLineFieldsFromApplication
Could you please create the following Integration events in Table 81 - Gen. Journal Line - , in function SetJournalLineFieldsFromApplication?
LOCAL SetJournalLineFieldsFromApplication()
"Exported to Payment File" := FALSE;
GetAccTypeAndNo(Rec,AccType,AccNo);
CASE AccType OF
AccType::Customer:
IF "Applies-to ID" <> '' THEN BEGIN
IF FindFirstCustLedgEntryWithAppliesToID(AccNo,"Applies-to ID") THEN BEGIN
// >>>>
OnAfterSetFieldsFromCustLedgerEntryApplication(Rec,CustLedgEntry);
// <<<<
CustLedgEntry.SETRANGE("Exported to Payment File",TRUE);
"Exported to Payment File" := CustLedgEntry.FINDFIRST;
END
END ELSE
IF "Applies-to Doc. No." <> '' THEN
IF FindFirstCustLedgEntryWithAppliesToDocNo(AccNo,"Applies-to Doc. No.") THEN BEGIN
"Exported to Payment File" := CustLedgEntry."Exported to Payment File";
"Applies-to Ext. Doc. No." := CustLedgEntry."External Document No.";
// >>>>
OnAfterSetFieldsFromCustLedgerEntryApplication(Rec,CustLedgEntry);
// <<<<
END;
AccType::Vendor:
IF "Applies-to ID" <> '' THEN BEGIN
IF FindFirstVendLedgEntryWithAppliesToID(AccNo,"Applies-to ID") THEN BEGIN
// >>>>
OnAfterSetFieldsFromVendLedgerEntryApplication(Rec,VendLedgEntry);
// <<<<
VendLedgEntry.SETRANGE("Exported to Payment File",TRUE);
"Exported to Payment File" := VendLedgEntry.FINDFIRST;
END
END ELSE
IF "Applies-to Doc. No." <> '' THEN
IF FindFirstVendLedgEntryWithAppliesToDocNo(AccNo,"Applies-to Doc. No.") THEN BEGIN
"Exported to Payment File" := VendLedgEntry."Exported to Payment File";
"Applies-to Ext. Doc. No." := VendLedgEntry."External Document No.";
// >>>>
OnAfterSetFieldsFromVendLedgerEntryApplication(Rec,VendLedgEntry);
// <<<<
END;
....
Event signatures:
LOCAL [IntegrationEvent] OnAfterSetFieldsFromCustLedgerEntryApplication(VAR GenJournalLine : Record "Gen. Journal Line";CustLedgerEntry : Record "Cust. Ledger Entry")
LOCAL [IntegrationEvent] OnAfterSetFieldsFromVendLedgerEntryApplication(VAR GenJournalLine : Record "Gen. Journal Line";VendorLedgerEntry : Record "Vendor Ledger Entry")
For our extension: we need to set more fields during application.
Theoretically we can use existing event OnAfterSetJournalLineFieldsFromApplication but in this case we need to copy the logic of getting customer and vendor ledger entries. We would like to avoid it.
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.
Hello colleagues,
The event was confirmed, but it is still missing in latest CU https://bcartifacts.azureedge.net/onprem/16.5.15897.15953/de
We need to copy values from the Cust/Vend Ledger Entry to General Journal. We need to know exact CV Ledger Entry.
We cannot use existing event OnAfterSetJournalLineFieldsFromApplication, because we are not able to find exact CV Ledger Entry: the algorithm of finding the CV Ledger Entry is hidden in local procedure and has unknown quantity of event subscribers (e.g. to event OnFindFirstVendLedgEntryWithAppliesToIDOnAfterSetFilters)
Please consider to add events as they were requested.