KRichardson
KRichardson

Reputation: 1010

Calling delegate for Acumatica Event with the _ event notation

Previously, in order to inject code in the middle of an event handler, you could use the code:

protected virtual void Customer_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
{
    // run before the base event 
    del?.Invoke(cache, e);
    // run after the base event 
}

With the new event style:

protected virtual void _(Events.RowSelected<Customer> e)

What is the proper way to call the delegate?

Upvotes: 1

Views: 254

Answers (1)

KRichardson
KRichardson

Reputation: 1010

I found an example in the code provided in the extension library for APInvoiceEntryExt.cs. The following code is how you would accomplish this:

protected virtual void _(Events.RowSelected<Customer> e, PXRowSelected del)
{
    // run before the base event 
    del?.Invoke(e.Cache, e.Args);
    // run after the base event     
}

Upvotes: 3

Related Questions