Well, if you do not wish to print anything, i.e. just process the sales order, you don't need to pass anything - it's an optional parameter.
Normally, the sales order form pops up a dialog asking about which (if any) reports to print. From this a report collection is built and passed to .Process(). Process() then processes the sales order and does the printing for you. Here's what our form does when you click the process button on the toolbar:
- Code: Select all
Try
Dim candidateReportsToPrint As JiwaApplication.JiwaCollection(Of JiwaApplication.PrintGroup.SalesOrderReports.SalesOrderReport) = SalesOrder.GetCandidateReportsToPrint()
Dim processSalesOrderDialog As JiwaSalesUI.SalesOrder.ProcessSingleOrder = JiwaApplication.Manager.Instance.StartDialog(56, New Object() {candidateReportsToPrint}, Me, "Sales Order Entry")
If processSalesOrderDialog.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
Dim reportsToPrint As New JiwaApplication.JiwaCollection(Of JiwaApplication.PrintGroup.SalesOrderReports.SalesOrderReport)
If processSalesOrderDialog.PrintType <> ProcessSingleOrder.PrintTypes.PrintTypeNoReport Then
' get selections and print
For Each salesOrderReport As JiwaApplication.PrintGroup.SalesOrderReports.SalesOrderReport In candidateReportsToPrint
If processSalesOrderDialog.PrintType = PrintReportSelection.PrintTypes.PrintTypeReportType Then
If salesOrderReport.DocumentType = processSalesOrderDialog.PrintTypeSelectedIndex Then
reportsToPrint.Add(salesOrderReport)
End If
Else
If salesOrderReport.Equals(candidateReportsToPrint(processSalesOrderDialog.PrintTypeSelectedIndex + 1)) Then
reportsToPrint.Add(salesOrderReport)
Exit For
End If
End If
Next
End If
SalesOrder.Process(reportsToPrint)
End If
Finally
' no matter what, we re-read
ProposedDrillDownID = _SalesOrder.InvoiceID
ReadRecord(ProposedDrillDownID)
End Try