ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Table 81 - Gen. Journal Line - SetJournalLineFieldsFromApplication

Open almatlansag opened this issue 7 years ago • 4 comments

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.

almatlansag avatar Nov 11 '19 19:11 almatlansag

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.

almatlansag avatar Nov 12 '19 13:11 almatlansag

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.

bc-ghost avatar Nov 29 '19 11:11 bc-ghost

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.

bc-ghost avatar Dec 13 '19 13:12 bc-ghost

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.

Mike-1984 avatar Sep 23 '20 16:09 Mike-1984