Showing posts with label LP. Show all posts
Showing posts with label LP. Show all posts

Wednesday, February 22, 2023

License plate label printing with new Label layout in Microsoft Dynamics 365 Supply Chain Management

In this blog post I would like to go through the new Label layout for License plate labels. This is a new capability that is available in 10.0.31.

This is quite powerful capability especially in the following situations:

- when you need to display on the label additional information that is not available in the WHSLicensePlateLabel table. Maybe you need to add information from the corresponding document that is stored, for example, in the Purchase order;
- when you need to display on your labels values with country-specific decimal and thousands separator;
- when you need to generate labels with repeating rows or even multiple labels out of one template.

Let's walk through the configuration and process.

Set up warehouse management parameters

To set up warehouse parameters for license plate label printing, follow these steps:

  1. Go to Warehouse management > Setup > Warehouse management parameters.
  2. On the License plates FastTab, make the following settings:
    • Use label layouts for license plate labels - Choose whether the system should use label layouts instead of document routing label layouts.  Set this to Yes to use label layout feature for license plate labels.


Create a license plate label layout

The label layout controls what information is printed on the label and how it's laid out. Here, you enter the ZPL code that is sent to the printer. Typically, you will copy this code from a label designer program.

As the system generates a label, it can replace field and method names that are used in the label layout with actual values. 

First label layout that we are creating is simple one. Only data from license plate table is printed on the label.

  1. Go to Warehouse management > Setup > Document routing > Label layout.
  2. At the top of the list pane, set the Label layout type field to License Plate Label.
  3. On the Action Pane, select New to create a label.
  4. Set the following values for the new label:
    • Label layout ID: Enter License plate.
    • Description: Enter License plate.
    • Label layout data source ID: Leave this field blank. (Only license plate data will be used.)
    • Enable label template support : Leave this option set to No for now. When it's set to Yes, you can add header, row, and footer elements to your layout
    • Date, time, and number format: Leave this field blank. This field is used to set the formats of date, time, and number values that are shown in a label layout, as described later in this article
5. Copy the following example of a ZPL container label.

CT~~CD,~CC^~CT~

^XA~TA000~JSN^LT0^MNM,0^MTT^PON^PMN^LH0,0^JMA^PR8,8~SD15^JUS^LRN^CI27^PA0,1,1,0^XZ

^XA

^MMT

^PW831

^LL609

^LS0

^FT19,59^A0N,28,28^FH\^CI28^FDLicense plate label^FS^CI27

^FT19,148^A0N,42,43^FH\^CI28^FDItem: ^FS^CI27

^FT128,148^A0N,42,43^FH\^CI28^FD$ItemId$ ^FS^CI27

^BY3,3,180^FT116,525^BCN,,Y,N

^FH\^FD$LicensePlateId$^FS

^FT19,206^A0N,42,43^FH\^CI28^FDQty:^FS^CI27

^FT128,206^A0N,42,43^FH\^CI28^FD$Qty$^FS^CI27

^PQ1,0,1,Y^XZ

6. On the Printer text Layout FastTab, paste the copied text into the large field.

7. Close the page.


 Second label layout that we are creating is when we need to display data from Purchase order . 

1. Go to Warehouse > Setup > Document routing > Label layout data source.

2. Create a label layout data source that includes a join to the Purchase order table.

3. On the Action Pane, select New.

4. Set the following values for the new label layout data source:

Label layout data source ID: Enter LPPlusPurchOrder.

Description: Enter License plate + Purchase order.

Label layout type: Select License plate label.

5. On the Action Pane, select Save.


6. On the Action Pane, select Edit query.

7. A standard query editor dialog box appears. On the Joins tab, add a join to the required tables.

8. Go back to the Label layout page, and then, in the Label layout data source ID field, select the new record for a new or existing layout.

9. You can now add the new field values to the print layout code. Be sure to reference the correct table.field-names values in the ZPL code. The additional tables will include a number (_#) as a suffix.

Example will look as below:


CT~~CD,~CC^~CT~

^XA~TA000~JSN^LT0^MNM,0^MTT^PON^PMN^LH0,0^JMA^PR8,8~SD15^JUS^LRN^CI27^PA0,1,1,0^XZ

^XA

^MMT

^PW831

^LL609

^LS0

^FT19,59^A0N,28,28^FH\^CI28^FDLicense plate label^FS^CI27

^BY3,3,180^FT116,525^BCN,,Y,N

^FH\^FD$WHSLicensePlateLabel.LicensePlateId$^FS

^FT19,148^A0N,42,43^FH\^CI28^FDItem: ^FS^CI27

^FT128,148^A0N,42,43^FH\^CI28^FD$WHSLicensePlateLabel.ItemId$^FS^CI27

^FT19,206^A0N,42,43^FH\^CI28^FDQty:^FS^CI27

^FT128,206^A0N,42,43^FH\^CI28^FD$WHSLicensePlateLabel.Qty$^FS^CI27

^FT19,264^A0N,42,43^FH\^CI28^FDOrder:^FS^CI27

^FT128,264^A0N,42,43^FH\^CI28^FD$PurchTable_1.PurchId$^FS^CI27

^PQ1,0,1,Y^XZ




Third label layout that we are creating is when we need to use more complex structure header, row and footer . We will do it with the help of label template support

If you must create more advanced label layouts, you can benefit from using some of the widely available label generation tools that are described in Document routing label layout.

To format a label by using header, row, and footer elements, open the Label layout page, select or create a layout, and set the Enable label template support option to Yes for the new or selected layout. Then use the {{Header ... }}, {{Row ... }}, and {{Footer ... }} elements in your code. The following example shows a label that includes all these elements. It prints data about items that are placed in a license plate.

First, we need to create label layout data source.


And the Query


Define to print only Put lines


Option 1:


{{LabelStart

^FX ... ZPL commands that will be printed on every label ...

CT~~CD,~CC^~CT~

^XA

~TA000

~JSN

^LT0

^MNM,0

^MTT

^PON

^PMN

^LH0,0

^JMA

^PR8,8

~SD15

^JUS

^LRN

^CI27

^PA0,1,1,0

^XZ

^XA

^MMT

^PW831

^LL609

^LS0

}}

{{Header

^FT31,59^A0N,28,28^FH\^CI28^FDLicense plate label with work lines^FS^CI27

^BY3,3,180^FT116,525^BCN,,Y,N

^FH\^FD$WHSLicensePlateLabel.LicensePlateId$^FS

}}

{{Row Table=WHsWorkLine_1 StartY=148 IncY=68 RowsPerLabel=5

^FT19,$position.YPos$^A0N,42,43^FH\^CI28^FDLine:^FS^CI27

^FT128,$position.YPos$^A0N,42,43^FH\^CI28^FD$WHSWorkLine_1.LineNum$^FS^CI27

^FT250,$position.YPos$^A0N,42,43^FH\^CI28^FD$WHSWorkLine_1.WMSLocationId$^FS^CI27

}}

{{LabelEnd

^PQ1,0,1,Y

^XZ

}}

Option 2:

{{LabelStart

^FX ... ZPL commands that will be printed on every label ...

CT~~CD,~CC^~CT~

^XA

~TA000

~JSN

^LT0

^MNM,0

^MTT

^PON

^PMN

^LH0,0

^JMA

^PR8,8

~SD15

^JUS

^LRN

^CI27

^PA0,1,1,0

^XZ

^XA

^MMT

^PW831

^LL609

^LS0

}}

{{Header

^FT31,59^A0N,28,28^FH\^CI28^FDLicense plate label with work lines^FS^CI27

^BY3,3,180^FT116,300^BCN,,Y,N

^FH\^FD$WHSLicensePlateLabel.LicensePlateId$^FS

}}

{{Row Table=WHsWorkLine_1 StartY=400 IncY=68 RowsPerLabel=5

^FT19,$position.YPos$^A0N,42,43^FH\^CI28^FDLine:^FS^CI27

^FT128,$position.YPos$^A0N,42,43^FH\^CI28^FD$WHSWorkLine_1.ItemID$^FS^CI27

^FT250,$position.YPos$^A0N,42,43^FH\^CI28^FD$WHSWorkLine_1.QtyWork$^FS^CI27

}}

{{LabelEnd

^PQ1,0,1,Y

^XZ

}}



Make sure that network printers setup.


Specify date, time, and number formats

To set the formats of date, time, and number values that are shown in a label layout, open the Label layout page, select or create a layout, and set the Date, time, and number format field to the language that uses the formats that you want.

Set up license plate label routing

To specify the license plate label layouts that are used and where they are printed, you must define a Document routing record, as described in the following procedure.

1. Go to Warehouse management > Setup > Document routing > Document routing.

2. In the Work order type field, select Purchase orders option.

3. On the Action Pane, select New to create a routing record.

4. On the header of the new routing record.

5. On the Document routing printers FastTab, assign the printer and label layout that should be used when the criteria for the routing record are met. Select New on the toolbar to add a line to the grid. 



Set license plate labels to be printed automatically when purchase orders are received

If you want a license plate label to be printed automatically each time that a new purchase order is received, you can configure eigher work template with Print step or mobile device menu item.

Option 1

1. Go to Warehouse management > Setup > Work> Work templates.

2. In the Work order type field, select Purchase orders option.

3. On the Action Pane, select Edit.

4. Select the work template that license plate labels should automatically be printed for. If you're working with sample data, select the row where the Work template ID field is set to 24 PO Receipt.

5. Select New in the Work Template Details section.

6. For the new work template line, set the following fields:

○ Work type – Select Print . 

○ Work class – Select Purchase.

7. Select Save. 

8. Use Move up button to place new line between Pick and Put lines.

9. Close the page.

 Option 2 (most preferable way of doing it)

1. Go to Warehouse management > Setup > Mobile device > Mobile device menu items.

2. Select New.

3. Create a record that has the following settings:

○ Menu item name: Mixed

○ Title: Mixed LP receiving

○ Mode: Work

○ Work creation process: Mixed license plate receiving

Print label : Yes


4. Add the new mobile device menu item to the menu

5. Go to Warehouse management > Setup > Mobile device > Mobile device menu.

6. Select Inbound menu.

7. In the tree, select the menu item that you created before.

8. Select Edit.

9. Select the arrow to add the menu item to the menu.

10. Select Save.

11. Close the page.


Run a scenario to print license plate labels

Create PO with 2 items



In this scenario we will be receiving items 3 times, and for each time will be changing document routing layout to see the difference between layouts. 

Log in to mobile device emulator

https://xxx.operations.dynamics.com/?mi=action:WHSWorkExecute&cmp=USMF

Select Mixed LP mobile device

Scan LP number

Scan PO number

Scan Item 1 and Qty 1

Scan Item 2 and Qty 2

Select LP complete


Select OK

License plate label will be printed. In this scenario we selected first layout where we print only license plate label details from the license plate table. 


Item is blank, because Item on LP label is actually blank since contains multiple items.

Let's select the second label layout in the Routing to see how it looks. 

We will be using the same PO, just create another LP in the mobile device


LP printed. Now we see that additional information is getting printed (order number) from the purchase order table. 

And Label generated as below

And now let's check the last layout where we have repetitive header with license plate ID and rows from the license plate items.



And license plate label is generated as below.

Note: If for some reason label is not printed, make sure you set the right query on the Label Layout data source and it does not contain criteria that are not valid for your scenario.

Another point worth mentioning is that you might notice different behavior for printing LP label by using Print label option on mobile device menu item or if you are using Work template line step Print. 
The reason because license plate labels generated differently. 

In case of Print label on the mobile device menu item: There will be 1 LP label generated for multiple items within the same LP and Item number will be blank on the label.
In case of Print step on the work template: There will be as many LP labels generated as many items within the same LP and Item number will be set for each label.

That's it for today!