Jump to content

Label Fields

From Commander4j

Label Fields lists every value you can place on a label template. This is the page to open when you want to add something to a label and need to know what it is called.

A value is placed on the label by writing its name between <* and *>. When the label is printed, Commander4j replaces the placeholder with the real value for that pallet or case.

^FD<*DESCRIPTION*>^FS

prints the product description. Names are written in capitals exactly as listed below. See Label Template Syntax for how a whole template is put together and Label Function Syntax for ways to format a value before it is printed.

Which names are available depends on which screen prints the label, because each screen reads a different set of data. The tables below are split the same way. If a name is used that is not available, the label prints the name followed by not found! in its place, so a mistake is visible on paper rather than silent.

Pallet labels

These fields are available on labels printed from the Pallet Label screen and from the other pallet screens that can print a label: Production Declaration, Pallet Issue, Pallet Return, Split Pallet and the pallet label re-print dialog. The values are read from the pallet record together with its material, batch and customer.

Field Type What it prints
SSCC text The 18-digit pallet number.
MATERIAL text Product code.
DESCRIPTION text Product description from Materials.
OLD_MATERIAL text The previous product code held on the material, if you use one.
EAN text GTIN of the unit on the pallet. Usually wrapped in PADLEFT to make it 14 digits: <PADLEFT(<*EAN*>,14,0)>
VARIANT text GS1 variant of the unit on the pallet, usually padded to 2 digits.
QUANTITY number Number of units on the pallet. Printed as a whole number padded to 4 digits unless a format is given, for example <*QUANTITY^0*> for no padding.
UOM text Unit of measure for QUANTITY.
LAYERS number Number of layers on the pallet.
BATCH_NUMBER text Batch or lot number.
PROCESS_ORDER text Process order number.
REQUIRED_RESOURCE text Production line or resource from the process order.
DATE_OF_MANUFACTURE date Date of manufacture. Prefer the PRODDATE function, which formats it for you.
EXPIRY_DATE date Expiry date held against the batch. Prefer the EXPIRYDATE function, which picks the batch or pallet date according to the EXPIRY DATE MODE setting.
SSCC_EXPIRY_DATE date Expiry date held against the pallet. Only populated when EXPIRY DATE MODE is SSCC.
DATE_CREATED date and time When the pallet record was created. Prefer the DATE_CREATED function.
DATE_UPDATED date and time When the pallet record was last changed.
CREATED_BY_USER_ID, UPDATED_BY_USER_ID text Who created or last changed the pallet record.
CUSTOMER_ID text Customer code from the process order.
CUSTOMER_NAME text Customer name from Customers.
PRINT_ON_LABEL text The customer's print-on-label flag from Customers.
LOCATION_ID text Where the pallet currently is.
STATUS text Pallet status.
CONFIRMED text Y once the pallet has been confirmed, otherwise N.
DESPATCH_NO text Despatch number, blank until the pallet is despatched.
MHN_NUMBER, DECISION text Master hold notice number and quality decision, if the pallet is on hold.
EQUIPMENT_TYPE text The pallet or equipment type.
GROSS_WEIGHT, NET_WEIGHT, WEIGHT_UOM number, number, text Weights held on the material record. For the total pallet weight use the PALLET_WEIGHT_TEXT function.
PART_NO text The customer's part number for this material, from Customer Data.
CASE_CONTENT text Free text describing the case contents, from Customer Data.
ALT_TEXT_1 text Spare free text for this material and customer, from Customer Data.
BASE_EAN, BASE_VARIANT text GTIN and variant of the base unit of the material.
BASE_UOM text The base unit of measure.
BASE_QUANTITY number Pallet quantity converted into base units.

Case and tray labels

These fields are available on labels printed from the Case Label screen. Note that several names differ from the pallet list: the GTIN is PROD_EAN here rather than EAN, the description is MATERIAL_DESCRIPTION, and there is no SSCC or LAYERS. A pallet template used as a case label prints "not found!" for those.

Field Type What it prints
UNIQUE_ID text Internal identifier for this print request.
MATERIAL text Product code.
MATERIAL_DESCRIPTION text Product description.
MATERIAL_TYPE text Material type code.
PROD_EAN, PROD_VARIANT text GTIN and variant of the unit being labelled.
PROD_QUANTITY number Quantity being labelled.
PROD_UOM text Unit of measure for PROD_QUANTITY.
BASE_EAN, BASE_VARIANT, BASE_QUANTITY, BASE_UOM mixed The same values for the base unit.
BATCH_NUMBER text Batch number as printed.
BATCH_PREFIX, BATCH_SUFFIX text The parts added to the batch number, when used.
OVERRIDE_BATCH_PREFIX, OVERRIDE_MANUFACTURE_DATE, OVERRIDE_EXPIRY_DATE text Y when the operator overrode the default, otherwise N.
PROCESS_ORDER text Process order number.
REQUIRED_RESOURCE text Production line or resource.
LINE text The production line chosen on the screen.
LOCATION_ID text Location from the process order.
DATE_OF_MANUFACTURE date Date of manufacture. Add a format, for example <*DATE_OF_MANUFACTURE^dd/MM/yyyy*>.
EXPIRY_DATE date Expiry date. Add a format in the same way.
EXPIRY_MODE text BATCH or SSCC.
CUSTOMER_ID, CUSTOMER_NAME text Customer code and name.
PART_NO, ALT_TEXT_1 text Customer-specific text from Customer Data.
LABEL_TYPE text Pack or Pallet.
MODULE_ID text The report module that produced the label.
PRINT_DATE date and time When the label was requested.
PRINT_COPIES number Number of copies requested.
PRINT_QUEUE_NAME text The queue or printer chosen.
USER_ID, WORKSTATION_ID text Who printed it and from which PC.

Labels printed by the Quality Control Sample screen use their own, smaller set of fields and are not covered here.

Fields that are always available

These are added by Commander4j for every label template, whichever screen prints it.

Field What it prints
LABEL_NO The copy number, 1 for the first label of a pallet, 2 for the second and so on. The standard label prints it as L1, L2.
HEADER_COMMENT The text of the LABEL_HEADER_COMMENT system key, but only when the header text tick box on the printing screen is ticked. It is ticked by default. Otherwise blank.
PLANT The PLANT system key.
EXPIRY_DATE_MODE The EXPIRY DATE MODE system key, BATCH or SSCC.
ZPL_LABEL_COUNT The number of copies requested, for use with the ZPL ^PQ command. See the DEFINE BARCODE COUNT_MODE note in Label Template Syntax.

Values that are not fields but are useful on a label, such as the current user, the date and time of printing, and the Commander4j version, come from functions: <USERNAME()>, <TIMESTAMP(dd/MM/yyyy HH:mm)> and <VERSION()>.

Formatting a value

A format can follow the field name after a ^ character. It applies to dates, times and numbers only, and is ignored for text.

Example Prints
<*DATE_OF_MANUFACTURE*> 2026-03-01 (the default date format is yyyy-MM-dd)
<*DATE_OF_MANUFACTURE^dd/MM/yyyy*> 01/03/2026
<*PRINT_DATE^HH:mm*> 16:46
<*QUANTITY*> 0224 (the default number format is 0000)
<*QUANTITY^0*> 224
<*QUANTITY^000000*> 000224

Date formats use the Java pattern letters: dd day, MM month, yy or yyyy year, HH hour, mm minute, ss second. Number formats use 0 for a digit that is always printed and # for a digit that is printed only when needed.

Two things to be aware of:

  • Round brackets in a text value are printed as curly braces, so a description of Widget (Blue) appears as Widget {Blue}. This protects the function syntax, which uses round brackets.
  • If a date format is invalid the label prints the field name and an error message in place of the date.

AutoLab4j

AutoLab4j prints the same template files with the same placeholders and the same functions, but it is not connected to the database. Its values come from the dataset CSV file that Commander4j writes when a process order is assigned to a line, and the field names are the column headings of that file. The list is on AutoLab4j Dataset CSV. The ^format suffix described above is not applied by AutoLab4j, so dates and numbers are printed exactly as they appear in the CSV.

LabelServer4j keeps its own copy of the label files, in its own folders, one set per site. They are not shared with the Commander4j labels folder, so a change made to a Commander4j template has to be repeated in the LabelServer4j copy. Its command scripts can carry the same printer commands, but a value is written as $data_NAME, where NAME is a column of the dataset CSV, and formatted with functions such as SUBSTRING, REPLACE and EXTRACT_DATE. See LabelServer4j Operation and LabelServer4j Dataset CSV.

Barcode variables

A name defined with DEFINE BARCODE at the top of the template can also be used as a field. In the standard label, <*BARCODE1*> and <*BARCODE2*> are the two GS1-128 barcodes with their code-set switching already worked out. This is explained in Label Template Syntax.

For database administrators

The pallet fields are the columns of the database view VIEW_PALLET_EXPIRY and the case fields are the columns of VIEW_LABEL_DATA. The columns are the same on MySQL, Microsoft SQL Server and Oracle. A site that needs an extra value on its labels can have these views extended, but the change is overwritten by upgrades, so talk to support first.

See also