Labelling
Advanced Production includes a complete label printing engine. You design a label once as a template, tell the system which template to use for each item, and the system fills in the values and sends it to a printer whenever a label is needed.
Labels can print automatically when you post production output, an assembly, or an item transformation, and can be printed or reprinted on demand for any lot.
How labelling fits together
Five pieces of setup work together. It is worth understanding the shape before configuring anything.
| Piece | What it is |
|---|---|
| Label Template | The label design itself, plus the rules for filling in its values. |
| Label Type | A classifier such as PACK or LOT, used to distinguish labels that serve different purposes. |
| Label Selection | Decides which template to use, for a given item and label type. |
| Printer Selection | Decides which printer to send it to, for a given user, location, type and template. |
| Field Mapping | Lines under a template that replace each placeholder with a real value. |
A template is never tied directly to an item. The link is always made through a Label Selection record, which is what allows one template to serve many items and one item to have several labels for different purposes.
Label templates
Open the Label Templates page to create and maintain templates.
| Field | Description |
|---|---|
| Code | Unique identifier, up to 50 characters. |
| Description | A friendly name. This is also used as the print job title. |
| Source Table | The table the template draws its values from, for example Item Ledger Entry or Lot No. Information. |
| Replacement Method | How placeholders are found in the content. Replace does a plain, case-sensitive text replacement. Regex treats the placeholder as a regular expression. |
| Label Service Code | The label service used to preview the template, including the label size. Leave blank if the template is not previewed. Used only to preview the label; it does not change how the label prints. See Previewing labels. |
The label design itself is stored on the template as content, written in whatever label definition language your printer accepts. Common examples include:
| Language | Typically used by |
|---|---|
| ZPL, ZPL II | Zebra |
| CPCL | Zebra mobile printers |
| EPL | Eltron and Zebra |
| DPL | Datamax-O'Neil and Honeywell |
| IPL, Fingerprint | Intermec and Honeywell |
| SBPL | SATO |
| TSPL, TSPL2 | TSC |
| PGL | Printronix |
| ESC/P, ESC/POS | Epson and many receipt printers |
The system does not interpret the language. It replaces the placeholders and passes the content through to the printer unchanged, so any plain-text label definition language your printer understands will work, including one not listed here.
Use Import Label Content on the Label Templates page to load the design from a file.
A template with no content cannot print. If you try, you get "Label {code} is empty." Import the content before using the template.
Placeholders
A placeholder, or token, is any piece of text in the label content that you want replaced at print time. There is no fixed syntax — a placeholder is simply the exact text you enter in the Place Holder field on a field mapping line, and the system replaces every occurrence of it.
Choose placeholder text that cannot appear accidentally in your label content, or in the command syntax of the label definition language itself. Distinctive markers such as @ITEMNO@ or $$LOTNO$$ are safer than a bare word.
Field mapping
Field mappings are the lines under a template that tell the system what to put in place of each placeholder. Open them from the Label Templates page.
Each line has a Place Holder and a Type, plus optional transformation, formatting and padding.
Mapping types
| Type | Where the value comes from | Required |
|---|---|---|
| Field/Related Field | A field on the source table, or a field on a related table reached through a relation. | Field No. |
| Item | A field from the item master record. | Field No. |
| Lot Attribute | A lot attribute value captured against the lot. | Related Field/Value |
| Item Attribute | An item attribute value. | Related Field/Value |
| Item UOM | Unit of measure information from the item. | Related Field No. |
| Item Variant | A field from the item variant record. | Related Field No. |
| Constant | Fixed text you type in. Useful for headings and static markings. | Constant Value |
| Custom | An extension point for values that need bespoke logic. | — |
The Field Mapping page marks Field No., Related Field No. or Related Field/Value as mandatory when a line needs it. If one is missing when the label prints, printing stops with an error naming the placeholder and the template.
Field No. and Related Field No.
For Field/Related Field and Item lines, Field No. is always required, because it is where the value is read from.
- To print a field from the source table, fill in Field No. only, and leave Related Field No. blank.
- To print a field from a related record, fill in both. The value of Field No. is used to find the related record, and Related Field No. is the field printed from it. For example, to print the item description on a template whose source table is Break Bulk Entry, set Field No. to Item No. and Related Field No. to Description.
When you choose a Field No. that relates to another table, the Related Table is filled in for you. If you only want to print the field itself, for example a unit of measure code, leave Related Field No. blank.
Transformation rules
A transformation rule converts the raw value into something else before it is formatted. These are most useful when the source field holds a code and you want to print something more meaningful.
| Rule | Result |
|---|---|
| (blank) | No transformation. |
| Get Item Description | Turns an item number into the item's description. |
| Get Item GTIN | Turns an item number into the item's GTIN. |
| Get Item Warehouse Class | Returns the item's warehouse class code. |
| Get Item Compliance Type | Returns the item's compliance type. |
| Get Expiration Date | Turns a lot number into that lot's expiration date, read from an open item ledger entry for the lot so it reflects any change made by a reclassification. |
| Weight 6 Digits 3 Decimals | Turns a weight into 6 digits representing thousandths, as used in fixed-width weight barcodes. For example, 0.202 becomes 000202, 0.2 becomes 000200 and 1 becomes 001000. Values with more than 3 decimals are rounded. Printing stops with an error if the value is not a number from 0 to 999.999. |
Formatting methods
| Method | Result |
|---|---|
| None | The value is printed as it is. |
| AL Format String | Applies the format string you enter, for example a date or decimal format. |
| GS1 GTIN | Treats the value as a GTIN and applies GS1 check digit handling. |
| GS1 | General GS1 formatting with check digit handling. |
| SSCC 00, SSCC 98, SSCC | Serial Shipping Container Code formats. |
Padding
Padding gives a value a fixed width, which matters for barcodes and fixed-width layouts.
| Setting | What it does | Example |
|---|---|---|
| Padding Side | Adds characters to the Left or Right. None turns padding off. | Left changes 123 to 00000123. |
| Padding Length | The total number of characters, between 0 and 250. | 8 makes 123 eight characters long. |
| Padding Character | The character to add. Leave blank to pad with spaces. | 0 adds zeroes. |
Selecting None in Padding Side clears the length and character.
Values are never shortened. A value of 123456789 stays as 123456789 even when the padding length is 8.
When padding is enabled, a blank value is also padded. A blank value with Left, length 8 and character 0 prints as 00000000. If you need blanks to stay blank, set Padding Side to None.
Order of operations
Understanding the order matters, because each step feeds the next.
- Read the raw value from the source.
- Apply the Transformation Rule.
- Apply the Formatting Method.
- Apply padding.
- Replace the placeholder in the label content.
So a mapping can turn an item number into a description, then pad that description — not the other way round.
Copying mappings between templates
A template with twenty mappings is tedious to rebuild. Use the Copy Label Field Mapping report to copy every mapping from one template to another.
- Choose the From template and the To template.
- Set Add To Existing Mapping.
- Leave it unchecked to replace the destination's mappings entirely. You are asked to confirm.
- Tick it to add the source mappings alongside the ones already there.
Conditional templates
A conditional template prints a block of content only when a value meets a condition. Use it for content that should appear on some labels but not others — a warning block, an allergen statement, an export marking.
Set up the block on the Conditional Templates page, then reference it from a field mapping line.
| Field | Description |
|---|---|
| Code | Unique identifier. |
| Description | What the block is for. |
| Run On | Value is True or Value is False. Blank means the block never prints. |
| No. of Labels | How many times the block is repeated when the condition is met. |
At print time the system evaluates the mapped value. If the condition is met, the placeholder is replaced with the conditional content. If it is not met, the placeholder is removed entirely, leaving nothing behind.
Label selection
Label Selection is what connects an item to a template. Configure it on the Label Selection Setup page.
| Field | Description |
|---|---|
| Type | Item for normal item labels, or License Plate / PrePrinted License Plate for warehouse license plates. |
| Item No. | A specific item, or blank. |
| Item Category Code | An item category, or blank. |
| Label Type | The label type this rule applies to. |
| Label Template Code | The template to use. |
| No. of Labels | A copy multiplier for this rule. |
The system resolves the template from the most specific rule to the least:
- Matching item and label type.
- Matching item category and label type.
- A default for the label type, with both item and category blank.
For the two license plate types, item and category must be blank — those rules are not item-specific.
Printers
Printer Selection decides where a label goes. Configure it on the Printer Selection (Labels) page.
| Field | Description |
|---|---|
| User ID | A specific user, or blank for all users. |
| Location Code | A specific location, or blank for all locations. |
| Label Type | The label type this printer serves. |
| Label Template Code | The template, or blank for any template of the type. |
| Printer Name | The printer to send the job to. |
Selection narrows from the most specific match to the least, so a rule naming both a user and a location wins over a general one.
If nothing matches, printing fails with an error naming the type, item, location, label type, template and printer it was looking for. That message is the fastest way to see which Printer Selection record is missing.
Printing mode
Label Printing Mode, on the Labelling tab of Advanced Production Setup, controls where every label goes. It is invaluable when setting templates up.
| Mode | Result |
|---|---|
| Send to Printer | Sends the label to the selected printer. |
| Export to File | Downloads the label content as a file instead of printing. |
| Show on Screen | Displays the label content on screen. |
| Preview | Shows the label as it will print, in the PDF viewer. Needs a label service on the template. See Previewing labels. |
Use Export to File, Show on Screen or Preview while you are building a template, so you can confirm every placeholder resolved correctly without wasting label stock.
Label reports that have a request page, such as Print Lot Label, Reprint Lot Label, Output Jnl. Post and the license plate reports, also have a Label Output field. It defaults from the Label Printing Mode and applies to that run only, so you can export or preview a label without changing the setup for everyone. Labels printed automatically, for example on posting or from a mobile device, always use the Label Printing Mode.
Previewing labels
Labels can be previewed as they will print, using an external label service. The label is rendered as a PDF and opened in the built-in PDF viewer, with one page for each label. The service type decides which label language can be previewed. At present the only service type is Labelary (ZPL), which uses the Labelary service to render ZPL.
To turn preview on:
-
Open the Label Services page and create a label service for each label size you use, for example
LABELARY-100X75.Field Description Code, Description Identify the label service. Service Type The external service, and so the label language it can preview. Service URL The address of the service. Choose the ... (assist edit) button to fill in the default address for the service type, after confirming that label details will be sent to it. Label Width (mm), Label Height (mm) The size of the label. Print Density (dpmm) The printer's density in dots per millimetre: 6 (152 dpi), 8 (203 dpi), 12 (300 dpi) or 24 (600 dpi). These settings are used only to preview labels. They do not change the label content or how labels print.
-
On each label template you want to preview, choose the Label Service Code. A template without a label service cannot be previewed, which is how preview is turned on or off for each template.
You can then:
- Choose Preview Label on the Label Templates page to see the template layout, with the placeholders shown as their placeholder text.
- Set the printing mode, or the Label Output on the Break Bulk Labeling page, to Preview to see labels filled in with real values.
A printer is not needed to preview a label.
Previewing sends the label details, including item numbers, lot numbers and dates, outside Business Central to the external Labelary service. Only turn preview on if your organisation is comfortable with that.
Labelary is a third-party service. We do not provide, support or control it, and its terms of service, limits and availability may change at any time without notice. Review Labelary's terms before you use it. At the time of writing, the free service needs no sign-up or API key, and allows up to 5,000 previews a day and 50 labels in each preview.
The extension must also be allowed to make outbound requests, which is set with Allow HttpClient Requests on the Extension Management page.
Adding another label service
Label services can be extended to support other services and label languages. Extend the Label Service Type_AP_TSL enum with a new value, and implement the Label Preview Service_AP_TSL interface in a codeunit. It has two methods: RenderPDF, which turns the label content into a PDF using the label service settings, and GetDefaultServiceUrl, which supplies the address for the assist edit.
PrintNode
Printing is handled through PrintNode, a cloud print service, by default. Each printer needs a printer ID, an API key and a print job URL so the system can submit the job. If a printer is not reachable you get a connection error, or the message returned by the service.
A different printing service provider can be used in place of PrintNode.
Number of copies
Two settings combine:
- No. of Label Copies to print on the Item Card. If it is zero, one copy is assumed.
- No. of Labels on the Label Selection record. If it is greater than zero, it multiplies the item figure.
An item set to 3 copies, with a Label Selection set to 2, prints 6 labels.
No. of Label Copies to print can only be set on an item that has Print Label on Output enabled.
When labels print
Automatically on production output
Set Print Label on Output on the Item Card. Labels then print when output is posted for that item.
Automatically on assembly posting
Enable Print Labels after Post Transformation on Advanced Production Setup. Labels print for assembly output on items that have Print Label on Output set.
Automatically on item transformation
Enable Item Transformation Order Label Printing on Advanced Production Setup. Labels print after an item transformation order is posted.
On demand for a lot
Run the Print Lot Label report. Filter to the item, variant and lot you want, and choose the label type. You can also reach this from Item Ledger Entries, where the action pre-fills the item, variant and lot from the selected entry.
Reprinting
Run the Reprint Lot Label report. Reprinting is limited to lots that still have inventory.
Label Reprint Max Value on Advanced Production Setup caps how many labels one run may reprint. Exceeding it stops the run before anything prints, so an accidental bulk reprint cannot flood the printer.
License plates
Where Tasklet Mobile WMS is in use, license plate labels print as part of mobile warehouse operations, using the License Plate and PrePrinted License Plate selection types.
Lot attributes on labels
Lot attributes hold extra information against a lot — a supplier's lot reference, a grade, a use-by date — and can be printed on labels.
Define them on the Lot Attribute Labels page. An attribute can be Text or Date, and can be validated against another table so that only valid values are accepted.
Use Default Lot Attributes to pre-assign attribute values by item, item category, or all items, so operators do not retype them for every lot.
To print an attribute, add a field mapping with Type set to Lot Attribute and reference the attribute code.
Lot Attributes Enabled on Advanced Production Setup switches the whole lot attribute capability on or off.
Setting up labelling from scratch
- On Advanced Production Setup, set Label Printing Mode to Show on Screen while you build.
- Create your Label Types, for example
PACKandLOT. From the Label Types page, Label Templates opens the templates used by the selected label type. - Create a Label Template and import its content.
- Add Field Mapping lines, one per placeholder.
- Add a Label Selection record linking item or category, label type and template.
- Add a Printer Selection record so the label has somewhere to go.
- On the Item Card, set Print Label on Output and No. of Label Copies to print if the label should print automatically.
- Test with Print Lot Label and check every placeholder resolved.
- Set Label Printing Mode back to blank so labels go to the printer.
Troubleshooting
| Message or symptom | Cause | What to do |
|---|---|---|
| "Label {code} is empty." | The template has no content. | Import the label content on the Label Templates page. |
| "No printer selection found for the specified parameters…" | No Printer Selection record matches. | Add a Printer Selection record. The message lists the values it searched on. |
| "You can reprint only {n} labels at a time." | The reprint exceeds the configured cap. | Reduce the selection, or raise Label Reprint Max Value. |
| A placeholder prints as literal text | No field mapping has that exact Place Holder value, or the case does not match. | Check the placeholder text on the mapping line. Replace is case-sensitive. |
| A value prints blank | The source field is empty, or a transformation found nothing. | Check the mapping's type, source field and transformation rule. |
| A blank value prints as zeroes | Padding pads blank values too. | Set Padding Side to None for that mapping. |
| A value is not shortened as expected | Padding never truncates. | Shorten the value at source, or use a format string. |
| Nothing prints at all | The label content resolved to nothing. | Confirm the template has content and at least one lot matched the filters. |