Setting queues
The following code is for an event handler that you can use to set queues. This example produces a dialog for each invoice. The dialog asks you if you want to add the invoice to a queue.
If you click Yes, a new dialog is displayed that prompts you to enter the queue number you want to add the invoice to.
Dim ret As Long
Dim retq As Long
Dim iQueue As Integer
ret = MsgBox("Add invoice to queue(s)?", 4) ' Creates a dialog with Yes/No buttons
If ret = 6 Then
retq = InputBox("Add invoice to queue(s) number:") ' Prompts user for queue number
End If
If IsNumeric (retq) And Trim(retq) <> "" Then
iQueue = Val(retq) ' Uses the user input as queue number
Application.Invoice.SetQueues (iQueue) ' Sets the queue
MsgBox "Queue set to " + Str(iQueue)
Else
MsgBox "Queue not set"
End If
Related topics