Label Function Syntax: Difference between revisions

From Commander4j
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
There are a number of functions which you can embed in your barcode label template to help format the data before sending to a labeller.
There are a number of functions which you can embed in your barcode label template to help format the data before sending to a labeller.
Referencing field names uses this syntax.
<*fieldname*>
for example
<*SSCC*>  <*QUANTITY*>  <*DESCRIPTION*>


===DATE_CREATED===
===DATE_CREATED===
Line 8: Line 16:


  <DATE_CREATED(ddMMyy)>
  <DATE_CREATED(ddMMyy)>
  <DATE_CREATED(dd/MM/yyyy)>
  <DATE_CREATED(dd/MM/yyyy)>


Line 26: Line 33:


  <EXPIRYDATE(MM yyyy)>
  <EXPIRYDATE(MM yyyy)>
  <EXPIRYDATE(MM)>
  <EXPIRYDATE(MM)>
  <EXPIRYDATE(yy)>
  <EXPIRYDATE(yy)>
<EXPIRYDATE(dd)> <EXPIRYDATE(MM)> <EXPIRYDATE(yyyy)>


===IIF===
===IIF===
Line 41: Line 47:


===JULIAN_YJJJ===
===JULIAN_YJJJ===
This function returns the production / manufacturing data in the format {last digit of year}{Julian day number}
<JULIAN_YJJJ()>
===LEFT===
===LEFT===
<LEFT(fieldname,5)>
===LOWERCASE===
===LOWERCASE===
<LOWERCASE(fieldname)>
===LTRIM===
===LTRIM===
<LTRIM(fieldname)>
===PADLEFT===
===PADLEFT===
  <PADLEFT(fieldname,14,0)>
This function pads out the size of a string to the length specified using the character specified.
It adds any additional characters to the left size of the string.
===PADRIGHT===
===PADRIGHT===
  <PADRIGHT(fieldname,14,0)>
This function pads out the size of a string to the length specified using the character specified.
It adds any additional characters to the right size of the string.
===PALLET_WEIGHT_BARCODE===
===PALLET_WEIGHT_BARCODE===
<PALLET_WEIGHT_BARCODE(KG,3)>
===PALLET_WEIGHT_TEXT===
===PALLET_WEIGHT_TEXT===
===PRODDATE===
===PRODDATE===
===RIGHT===
===RIGHT===
<RIGHT(fieldname,5)>
===RTRIM===
===RTRIM===
<RTRIM(fieldname)>
===SUBSTRING===
===SUBSTRING===
===SUBTR_LPAD===
===SUBTR_LPAD===
Line 56: Line 99:
===TRIM===
===TRIM===
===UPPERCASE===
===UPPERCASE===
<UPPERCASE(fieldname)>
===USERNAME===
===USERNAME===
===VERSION===
===VERSION===

Latest revision as of 13:12, 6 September 2024

There are a number of functions which you can embed in your barcode label template to help format the data before sending to a labeller.

Referencing field names uses this syntax.

<*fieldname*>

for example

<*SSCC*>  <*QUANTITY*>  <*DESCRIPTION*>

DATE_CREATED

This function returns the date & time when the pallet record was created in the database and allows you to specify the format that you want it formatted in the label.

Example usage

<DATE_CREATED(ddMMyy)>
<DATE_CREATED(dd/MM/yyyy)>

If the value of the DATE_CREATED field is null or blank it will return spaces instead of date.

DATETIME

The function allows you to format a datetime/timestamp field value from the database and display it in the label using the format specified.

<DATETIME(fieldname,dd/MM/yyyy  HH:mm:ss)>

EXPIRYDATE

When a label is printed Commander4j will automatically calculate the expiry date of the product. It is important to realise however that the application has 2 modes for recording the expiry date. It can be associated with the individual pallet number (SSCC) or it can be associated with the batch number. The mode that the system is using is defined in System Keys using the setting called EXPIRY DATE MODE

This function will retrieve the value from the appropriate table based on the setting above.

<EXPIRYDATE(MM yyyy)>
<EXPIRYDATE(MM)>
<EXPIRYDATE(yy)>
<EXPIRYDATE(dd)> <EXPIRYDATE(MM)> <EXPIRYDATE(yyyy)>

IIF

<IIF,param1,param2,param3,param4>
IF param1 = param2 then
  return param3
else
  return param4

JULIAN_YJJJ

This function returns the production / manufacturing data in the format {last digit of year}{Julian day number}

<JULIAN_YJJJ()>

LEFT

<LEFT(fieldname,5)>

LOWERCASE

<LOWERCASE(fieldname)>

LTRIM

<LTRIM(fieldname)>

PADLEFT

 <PADLEFT(fieldname,14,0)>

This function pads out the size of a string to the length specified using the character specified.

It adds any additional characters to the left size of the string.

PADRIGHT

 <PADRIGHT(fieldname,14,0)>

This function pads out the size of a string to the length specified using the character specified.

It adds any additional characters to the right size of the string.

PALLET_WEIGHT_BARCODE

<PALLET_WEIGHT_BARCODE(KG,3)>

PALLET_WEIGHT_TEXT

PRODDATE

RIGHT

<RIGHT(fieldname,5)>

RTRIM

<RTRIM(fieldname)>

SUBSTRING

SUBTR_LPAD

TIMESTAMP

TRIM

UPPERCASE

<UPPERCASE(fieldname)>

USERNAME

VERSION