Print Command Script works from command line, not from Integration Builder
I am trying to build an integration to an ERP system that directly supports Bartender.
The ERP application generates files like these
%BTW% /AF="E:\somepath\somedocument.btw" /D="<Trigger File Name>" /PRN="\\server\printer" /DBTEXTHEADER=3 /R=3 /P
%END%
"fieldname1","fieldname2""fieldvalue1","fieldvalue2"
It may be worth to note that
- the string "<Trigger File Name>" is literally there (unlike somedocument.btw and \\server\printer)
- there is an empty fifth line
- the CSV data lines can be _very_ long, with _lots_ of fields
- the generated file is UTF-8 encoded, with a UTF BOM (byte order marker) prefix
The ERP application comes with sample ,btw documents for use with these files. These documents needed to be modified, because the database connection did not match with actual data. So I corrected the sample documents by editing a generated script file, deleting the first two lines, and the last empty lin. This left two lines, one with field names, one with field values. I replaced the old database connection to this text file, and then adjusted each referred database field.
When testing the integration I built for these files, I am getting an error message for each database field I refer to, like
An object on the template was set to read in the field
"ReceiptLabel.ReceiptLabel._RcvDtl_PONum". However, this field was not found. Proceed with
unknown fields as blank strings?
The test output shows the command line used:
Submitted BarTender Command Line '/AF="E:\somepath\somedocument.btw" /D="E:\somescanfolder\somescript.txt" /PRN="\\server\printer" /DBTEXTHEADER=3 /R=3 /P' on print server 'server'.
Now when I copy this command line and prepend the path for bartend.exe like this
"C:\Program Files\Seagull\BarTender Suite\bartend.exe" /AF="E:\somepath\somedocument.btw" /D="E:\somescanfolder\somescript.txt" /PRN="\\server\printer" /DBTEXTHEADER=3 /R=3 /P
then the job prints just fine, with all the expected actual data.
It may be worth to note that the path "E:\somescanfolder\somescript.txt" is pointing to the script file after having been renamed by Integration Builder.
Program: BarTender Integration Builder 2016 R8
License: Enterprise Automation (3 Printers)
Version: 11.0.8.3153 (64-bit)
OS: Windows Server 2012 Datacenter x64 build 9200
-
Pim Zandbergen
★ BarTender Hero ★
I notice my example Print Command Script above has lines 3 and 4 joined which is not the case.
Here is how it really looks:
line 1: %BTW% /AF="E:\somepath\somedocument.btw" /D="<Trigger File Name>" /PRN="\\server\printer" /DBTEXTHEADER=3 /R=3 /P
line 2: %END%
line 3: "fieldname1","fieldname2"
line 4: "fieldvalue1","fieldvalue2"
line 5:0 -
pthane
★ BarTender Hero ★
I have never tried to use the fieldname1....fieldvalue1 route I always set the label up linked to a dummy text file with the correct number of data fields and then in my trigger file the equivalent of your line 3 would not be needed and the file would look something like this. As you can see I have added values for 2 additional fields but left the 3rd one empty.
%BTW% /AF="E:\somepath\somedocument.btw" /D="<Trigger File Name>" /PRN="\\server\printer" /DBTEXTHEADER=3 /R=3 /P
%END%
"fieldvalue1","fieldvalue2",,"fieldvalue4"0 -
Pim Zandbergen
★ BarTender Hero ★
Thanks Peter. But unfortunately I have no control over the format of the trigger file.
This is how the ERP system creates it.
The ERP system was designed to integrate with Bartender Commander.
It did used to work there. I would expect Integration Builder to be fully backwards compatible.
0 -
pthane
★ BarTender Hero ★
I have just created a simple label and file and tested it and am getting the same error message. Playing around with the file etc. I was able to get if to print my data but I was still getting the error too.
I would suggest you send a copy of your trigger files and label format to the Tech Support Team and ask for some assistance from them.
Pete
0
Iniciar sesión para dejar un comentario.
Comentarios
4 comentarios