InvoiceReroute event

This event is fired after an invoice has been rerouted, but before it is saved to the database.

When using the Manager module

When an invoice is rerouted using the Manager module, the event is also used to prevent the reroute dialog from being displayed.

The first InvoiceReroute event is fired when someone tries to reroute one or more invoices. There are no active objects, and the parameters below are empty. This is how you can tell the events apart.

By returning evtCancel, the reroute of all selected invoices is aborted, and the reroute dialog is not displayed.

If evtOK is returned, the reroute dialog is displayed. If the operator chooses to continue, an additional InvoiceReroute event is fired for each selected invoice.

Syntax

Public Function InvoiceReroute(ProfileName As String, BuyerNumber As String) As Long

Parameters

ProfileName 

The name of the invoice profile that you want to route the invoice to.

BuyerNumber

The buyer number, according to the buyer registry master data, of the buyer that you want to route the invoice to.

Active objects

Invoice

InvoiceProfile

Return values

evtOK 

The invoice is rerouted.

evtCancel 

The operation is aborted and the invoice is not rerouted.

InvoiceRerouted event