ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Change] Codeunit Purch.-Post - OnBeforeCheckExternalDocumentNumber

Open MattiLE opened this issue 7 years ago • 3 comments

Hi, I want to check the external document number for an additional table. Therefore, it would be helpful if the global variables "GenJnlLineExtDocNo" and "GenJnlLineDocType" were add to the event "OnBeforeCheckExternalDocumentNumber" as parameters.

LOCAL [IntegrationEvent] OnBeforeCheckExternalDocumentNumber(VendorLedgerEntry : Record "Vendor Ledger Entry";PurchaseHeader : Record "Purchase Header";VAR Handled : Boolean;GenJnlLineExtDocNo : Code[35];GenJnlLineDocType : Integer)

MattiLE avatar Mar 21 '19 13:03 MattiLE

One more question: Why is the parameter VendLedgEntry passed as var in function CheckExternalDocumentNumber? If the VendLedgEntry is found, an error is thrown. In addition, the global variable VendLedgEntry is read again before use via the FindVendorLedgerEntry function (e. g. in the function UpdatePurchaseHeader or PostBalancingEntry).

In my case, an adjustment would be unnecessary if the parameter was not passed by var or if a local variable was used. Is the change possible?

Thank you very much!

MattiLE avatar Mar 21 '19 14:03 MattiLE

We already have this event:

LOCAL CheckExternalDocumentNumber(VAR VendLedgEntry : Record "Vendor Ledger Entry";VAR PurchaseHeader : Record "Purchase Header") OnBeforeCheckExternalDocumentNumber(VendLedgEntry,PurchaseHeader,Handled); IF Handled THEN EXIT;

AlexanderYakunin avatar Apr 02 '19 09:04 AlexanderYakunin

Hi Alexander,

you're right, the event already exists. But I needed the two additional parameters for my case (the global variables "GenJnlLineExtDocNo" and "GenJnlLineDocType").

Could you add the two parameters please?

MattiLE avatar Apr 02 '19 10:04 MattiLE