microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
768 stars 610 forks source link

[Event Request] T81 Gen. Journal Line - LookUpAppliesToDocCust #1050

Closed Bleika closed 5 years ago

Bleika commented 5 years ago

Hi,

I was about to request a new Event at the very end of fx LookupAppliesToDocCust so that any additional fields from CLE may be assigned to GenJnlLine.

However, I've found Request #696 (already accepted) that requests a similar thing 3-fold: (CustLedgEntry,VendLedgEntry,EmployeeLedgEntry). Please be aware that the request #696 contains errors: 1) There's a bug in the first one: It requests what I also need, but within LookupAppliesToDocVend instead of LookupAppliesToDocCust 2) It pretends to expose diferent recs (CLE,VLE,ELE) ALL through the same event OnAfterUpdateDocumentTypeAndAppliesTo(VAR Rec; 3 different LE);

Please consider implementing this in the following way in stead: 3 new events (1 per LedgerEntry Rec), each placed in the corresponding function, exposing Rec (GenJnlLine) as VAR plus the right LedgerEntry Rec:

Event declarations: LOCAL [IntegrationEvent] OnAfterLookUpAppliesToDocCust(VAR Rec : Record "Gen. Journal Line";CustLedgEntry : Record "Cust. Ledger Entry")

LOCAL [IntegrationEvent] OnAfterLookUpAppliesToDocVend(VAR Rec : Record "Gen. Journal Line";VendLedgEntry : Record "Vendor Ledger Entry")

LOCAL [IntegrationEvent] OnAfterLookUpAppliesToDocEmpl(VAR Rec : Record "Gen. Journal Line";EmplLedgEntry : Record "Employee Ledger Entry")

Calls: Within ACTION::LookupOK statement, just before the final END; in all 3 functions: in LookUpAppliesToDocCust: OnAfterLookUpAppliesToDocCust(Rec,CustLedgEntry); in LookUpAppliesToDocVend: OnAfterLookUpAppliesToDocVend(Rec,VendLedgEntry); in LookUpAppliesToDocEmpl:: OnAfterLookUpAppliesToDocEmpl(Rec,EmplLedgEntry);

AlexanderYakunin commented 5 years ago

This is already done, please check latest code and verify that you can close you request.

Bleika commented 5 years ago

Sorry for the late reply, I confirm that it's correct in the latest version Thanks