Todays exercise is seemingly simple: print a voluntary number of warehouse label copies where the standard Dynamics 365 SCM only prints one. The ingredients are quite exquisite and variegated:
Let’s start with a proof of concept: print as many labels as there are items. Assuming there are 3 items on the license plate (pallet), let’s print the same label 3 times. This sounds simple, yet you need the latest and the coolest feature Enhanced license plate label layouts. With that feature you can finally carve a substring from Dynamics data, but also format numbers and dates. This is exactly what we need.
In Warehouse management > Setup > Document routing > Document routing layouts, every Zebra label template ends with something like
which is the instruction to the label printer how many copies to print. Now replace this line with
The quantity as a real number is truncated to an integer on the label, and the ZPL printer makes as many copies as there were pieces on the pallet.
A real game changer is now the ability to parse a display method on the WMSLicensePlateLabel table. Let Dynamics calculate the number of copies on the fly, leveraging the PackingQty factor which is the number of pieces in the topmost unit of the Unit sequence group. Assuming the unit sequence group is PCS-BOX i.e. pieces in boxes and if the nominal quantity per box is 20, for a license plate with 100 items on it I would like to have 5 copies of the label.
Extend the WMSLicensePlateLabel as follows
final class WHSLicensePlateLabel_Extension
display Num noOfCopiesSimple()
return int2Str(this.PackingQty > 1 ? any2Int(roundUp(this.Qty / this.PackingQty,1)) : 1);
and embed it into the ZPL code like this:
Now the number of copies is dynamic, configurable and obeys the master data settings.
This brings the following prompt on the mobile device
You may also want to explore possibilities of simple validations and post-processing of the data captured on the Custom work screen:
Custom method tutorial.
The number of copies entered by the user is then interpreted by a more sophisticated display method:
display Num noOfCopies()
select firstonly Data from workLineCustom
exists join workLine
where workLine.WorkId == this.WorkId
&& workLine.WorkType == WHSWorkType::Custom
&& workLineCustom.WorkId == workLine.WorkId
&& workLineCustom.LineNum == workLine.LineNum;
noOfCopies = str2Int(workLineCustom.Data);
if (! noOfCopies)
noOfCopies = this.PackingQty > 1 ? any2Int(roundUp(this.Qty / this.PackingQty,1)) : 1;