December 2018
Beginner
210 pages
5h 7m
English
Now, we have all required event publisher functions in place and can raise events in the application code. All we need to do to raise an event is invoke the corresponding publisher function that was declared earlier.
To raise OnBeforeCreateInvoice and OnAfterCreateInvoice events, modify the CreateSalesInvoice function in the codeunit 50504 Customer Payments Mgt.. Add two function calls, OnBeforeCreateInvoice at the very beginning of the function, and OnAfterCreateInvoice before the EXIT statement:
PROCEDURE CreateSalesInvoice(VAR LeaseContractHeader : Record 50500) : Code[20];VAR SalesHeader : Record 36;BEGIN OnBeforeCreateInvoice(LeaseContractHeader); CreateSalesInvoiceHeader(SalesHeader,LeaseContractHeader); CreateSalesInvoiceLines(SalesHeader,LeaseContractHeader."No."); ...
Read now
Unlock full access