Table "ForNAV DirPrt Queue"
This table contains the jobs for direct print and the file service.
Properties
| Name | Value |
|---|---|
| DataPerCompany | False |
| Caption | ForNAV Print Queue |
| Permissions | tabledata "ForNAV DirPrt Setup" = rm |
Fields
| Name | Type | Description |
|---|---|---|
| ID | Integer | An incrementing number that identifies the job. |
| "Direct Printer Name" | Text[250] | Name of the direct printer or device to be used for this job. |
| ReportID | Integer | Report number. |
| "Report Name" | Text[50] | Name of the report. |
| "Local Printer" | Text[250] | Name of the printer on the machine where the print service is running. |
| Status | Enum "ForNAV Local Print Status" | Status of the job. |
| Service | Text[250] | Name of the service that has processed the job. |
| Document | Blob | The actual document to be processed. For a print job this is the binary data for the PDF or raw data for a Zebra printer or another type of printer that supports raw data. |
| Message | Text[1000] | Message returned from the processing service. |
| Size | BigInteger | Size in bytes of the job. |
| Owner | Text[250] | Name of the user who created the job. |
| "Document Name" | Text[250] | A descriptive name for the document. |
| Company | Text[100] | Name of the company where the job was created. |
| Settings | Blob | Printer settings in JSON format. |
| ContentType | Option | Content type of the print job. Valid options are PDF, Zebra, Package, and FileAccess. |
| Retries | Integer | Number of retries left for this job. |
| InstanceNo | Integer | The instance number of the process that handled the job. The direct print and file service can spawn multiple instances of the job processors to increase the prining performance. |
| "Session ID" | Integer | User session ID for the user who created the job. This can be used to collect the jobs on hold for a specific user. |
| Tag | Text[250] | An optional tag. |
| Response | Blob | Response from the locally installed service. |
| SystemId | Guid | |
| SystemCreatedAt | DateTime | |
| SystemCreatedBy | Guid | |
| SystemModifiedAt | DateTime | |
| SystemModifiedBy | Guid | |
| SystemCreatedByUserName | Text[50] | |
| SystemCreatedByFullName | Text[80] | |
| SystemModifiedByUserName | Text[50] | |
| SystemModifiedByFullName | Text[80] | |
| SystemRowVersion | BigInteger |
Methods
Create
Create a job on the direct print queue.
procedure Create(reportNumber: Integer; directPrinterName: Text; localPrinterName: Text; documentInStream: InStream; printerSettings: Text; documentName: Text; documentContentType: Option)
Parameters
| Name | Type | Description |
|---|---|---|
| reportNumber | Integer |
Report number. |
| directPrinterName | Text |
Direct printer name. |
| localPrinterName | Text |
Name of local printer. |
| documentInStream | InStream |
Document content. |
| printerSettings | Text |
Printer settings JSON. |
| documentName | Text |
Optional name of the printed document. |
| documentContentType | Option |
Content type of the document. |
Create
Create a job on the direct print queue.
procedure Create(reportNumber: Integer; directPrinterName: Text; localPrinterName: Text; documentInStream: InStream; printerSettings: Text)
Parameters
| Name | Type | Description |
|---|---|---|
| reportNumber | Integer |
Report number. |
| directPrinterName | Text |
Name of the direct printer. |
| localPrinterName | Text |
Name of the local printer. |
| documentInStream | InStream |
Document content. |
| printerSettings | Text |
Printer settings JSON. |
Create
Create a job for client print.
procedure Create(documentName: Text; directPrinterName: Text; documentInStream: InStream; documentContentType: Option)
Parameters
| Name | Type | Description |
|---|---|---|
| documentName | Text |
A descriptive name of the job content. The value is used in the queue. |
| directPrinterName | Text |
Direct printer name. |
| documentInStream | InStream |
A stream with the job content. |
| documentContentType | Option |
Content type of the document. |
CreatePackage
procedure CreatePackage(documentName: Text; directPrinterName: Text; documentJson: JsonObject)
Parameters
| Name | Type | Description |
|---|---|---|
| documentName | Text | |
| directPrinterName | Text | |
| documentJson | JsonObject |
WaitForResponse
Wait for a response on the current job.
procedure WaitForResponse(timeoutMilliseconds: Integer): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| timeoutMilliseconds | Integer |
The maximum time in milliseconds to wait for a response. |
Returns
| Type | Description |
|---|---|
| Boolean |
True, if a response was received within the timeout limit. |
WaitForResponse
Wait for a response on the current job. The response is converted into a JSON object.
procedure WaitForResponse(timeoutMilliseconds: Integer; var resultJO: JsonObject): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| timeoutMilliseconds | Integer |
The maximum time in milliseconds to wait for a response. |
| resultJO | JsonObject |
JSON object that will receive the result. |
Returns
| Type | Description |
|---|---|
| Boolean |
True, if a response was received within the timeout limit. |
DownloadPrintJobs
Download all jobs that are on hold for the current user session.
procedure DownloadPrintJobs()
Remarks
This is used for client print.
DownloadPrintJobs
Download all jobs within the filter on the DirPrtQueue record parameter.
procedure DownloadPrintJobs(var DirPrtQueue: Record "ForNAV DirPrt Queue")
Parameters
| Name | Type | Description |
|---|---|---|
| DirPrtQueue | Table "ForNAV DirPrt Queue" |
A record that holds the filter for the jobs to download. |
Remarks
This is used for client print when you want to process multiple jobs from one user action.
GroupSessionPrintJobs
Group all jobs that are on hold for the current user session. You can use this to group multiple jobs into one print job and make sure the sequence of printing is correct when printing from multiple services or instances. The jobs will be grouped per printer, so that routing is preserved.
procedure GroupSessionPrintJobs(MergeCollection: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| MergeCollection | Boolean |
GroupJobs
procedure GroupJobs(var DirPrtQueue: Record "ForNAV DirPrt Queue"; MergeCollection: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| DirPrtQueue | Table "ForNAV DirPrt Queue" | |
| MergeCollection | Boolean |
Restart
Restart the print job. A finished or failed job can be restarted. The status is set to ready and the job is picked up and processed again.
procedure Restart()
Events
OnAfterInsertPrintJob
This event lets you modify the job when it is created in the queue.
[IntegrationEvent(False,False)]
procedure OnAfterInsertPrintJob(var DirPrtQueue: Record "ForNAV DirPrt Queue")
Parameters
| Name | Type | Description |
|---|---|---|
| DirPrtQueue | Table "ForNAV DirPrt Queue" |
Record holding the job that was just inserted. |
OnGroupJobsSetFilter
This event is triggered after session filter is set but before the jobs are grouped for a session. You can use it to fine tune the session filter.
[IntegrationEvent(False,False)]
procedure OnGroupJobsSetFilter(var DirPrtQueue: Record "ForNAV DirPrt Queue")
Parameters
| Name | Type | Description |
|---|---|---|
| DirPrtQueue | Table "ForNAV DirPrt Queue" |
Record with the session filter already set. |
OnDownloadSetFilter
This event is triggered after session filter is set but before the jobs are downloaded for a session. You can use it to fine tune the session filter.
[IntegrationEvent(False,False)]
procedure OnDownloadSetFilter(var DirPrtQueue: Record "ForNAV DirPrt Queue")
Parameters
| Name | Type | Description |
|---|---|---|
| DirPrtQueue | Table "ForNAV DirPrt Queue" |
Record with the session filter already set. |
OnDownloadPrintJob
This event is triggered when a print job is being downloaded.
[IntegrationEvent(False,False)]
local procedure OnDownloadPrintJob(var DirPrtQueue: Record "ForNAV DirPrt Queue"; var DocumentStream: InStream; var FileName: Text; var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| DirPrtQueue | Table "ForNAV DirPrt Queue" |
Filtered record holding the jobs being downloaded. |
| DocumentStream | InStream |
Stream holding the document data to be downloaded. |
| FileName | Text |
Name of the file being downloaded. |
| IsHandled | Boolean |
Set to true to mark the download as handled. |