[Event Change] Codeunit Purch.-Post - OnBeforeCheckExternalDocumentNumber
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)
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!
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;
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?