I have the exact situation described in this question: Device Hub communication with printer queue
Due to the question having neither an accepted, nor an acceptable answer, I am asking the question again.
I have configured DeviceHub with Acumatica, and my printer is shown. I am sending the print job via a PXAction. Upon executing the action, DeviceHub logs the successful reception of the job, but the printer queue never receives it.
Here's my code, because this is StackOverflow:
public PXAction<PX.Objects.CR.BAccount> PrintAddressLabel;
[PXButton(CommitChanges=true)]
[PXUIField(DisplayName = "Print Label")]
protected void printAddressLabel()
{
BAccount baccount = Base.Caches[typeof(BAccount)].Current as BAccount;
string bAccountID = baccount.BAccountID.ToString();
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters["BAccountID"] = bAccountID;
PXReportRequiredException ex = null;
ex = PXReportRequiredException.CombineReport(ex, "ZRCRADDR", parameters);
SMPrintJobMaint.CreatePrintJobGroup("DYMOLABEL", ex, "Address Label");
}
Could someone point me in a helpful direction?
EDIT:
Upon further testing, I found the following:
Acumatica will print successfully to my DeviceHub printer using the built in printing processes. However, when printing one of those jobs, the DeviceHub logs show a POLL
event. When attempting to print from my code, DeviceHub records an NT
event, which never makes it to the printer queue.
Upon further testing, in 2019 R1 the logs have changed slightly. Printing Invoices from Acumatica results in an NT
event as well. However, there is one line different from a job created in Acumatica versus a job created in code.
Green = job from Acumatica
Orange = job from code
The line Printer DYMOLABEL - printing PDF to \\*printer*
is missing in the job sent from code.