...
Excerpt |
---|
In this video, you will be introduced to modifying the design of a label template, using the designer, and adding data using AL code. |
Prerequisites
- Please watch this video first Cloud Print: How to modify label-template
- A running system with Cloud Print set up and a separate print "Tenant". See Set up Cloud Print Service
...
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
Script til video
Agenda
Table of Contents | ||||
---|---|---|---|---|
|
...
In this video, we will modify the design of a label template using the designer and add our own, custom data using AL code.
Note: This video builds upon lessons learned in the previous video "How to Modify Label-template", so please watch that one first.
Objectives
The customer wants to make the following changes to the default label "Item Label 4x3" :
- Add custom data fields "Gross Weight" and "Warehouse Class Code"
- Remove Serial No. and Expiration Date -fields
- and enlarge the barcode, making it easier to scan from a distance
Create a mock-up label (optional)
Using the examples on "Docs" Standard Label Template Designs, we can visualize the changes by creating a mock-up label.
This can be helpful when deciding on layout changes. However, this step is entirely optional.
Lets find the Item Label 4x3 and copy it to an image editor. Now we can make the changes and have a good idea of what we want to achieve.
This is what we settle on.
...
Print the label
Let's start by printing the label as it is so we can track the changes, as we make them.
Using the Mobile Device, go to Print. Scan or input the Item. Select Template. Fill in the required steps.
If you don't have a printer with you, you can use the Designer to preview the label
Go to Business Central. Mobile Print Setup > Template > Select the template > Open in designer
Select Sample Data > Go to "Logged files" and select Preview
KLIP3 + KLIP3
Adding custom data using AL code
Using the Mobile WMS API, we can modify the "dataset" the label template uses to generate the label.
Let's see if Docs has an how-to article to do just that How-to: Add data to label-template
This seems like the right one.
We will copy the code and paste it into an extension that is dependent on mobile wms.
Looking at the code, we see that four values are set in the dataset.
ExtraInfo1 and 2 gets the values of the Items Gross Weight and Warehouse Class code.
Two adjoining label texts are also set, For that we simply use the Field captions of the Item table.
Note this syntax. The name of the value gets the value. And the name underscore "Label" gets the label-value.
We can now Publish the extension.
Verify data is sent to the cloud
With the code active we can now print the label again.
Using the "Mobile Print Log" it is easy to verify data is now included in the request.
If we open the Mobile Document Queue. Find the request so we can jump to the print log.
By inspecting the request, it is easy to verify that ExtraInfo1 and 2 are present.
Modify the template design
We can now delete the two unneeded elements and enlarge the barcode.
But let's make a copy of the template so we still have the default template available if we need it later.
Copy Template and give it a name.
Select it and Open in Designer.
To hide Serial No. and Expiration Date, select the elements or their container and Suspend them.
To shorten the lines, select them and change the length.
The barcode uses a fixed position, so we are allowed to drag it, as opposed to selecting it and changing the properties.
When we are happy with the position, it is time to change the size.
This is done by setting "module width" higher and using the preview function to check the result. We do this until the size is right.
And the last step is the save the template.
KLIP6
...