Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

You want to modify a label template by adding data to it

For a video

...

see Cloud Print: How to modify label-template and adding data

...



In this example, we will

...

be adding these fields to an Item Label

...

Short consise defintion...

  • more elaborate descri7ption....

Use case

Something will speed up line selection and reduces errors....

Behaviour on the device

When "X" then mobile will display "Y"

How to enable it

Something here

  • Step 1 - Something
    • Enables...
       
       
  • Step 2 - Something
    • Sets the...

Step 1 - Something

    // [Example 01]: Set something
    [.

  • Gross Weight
  • Warehouse Class Code

Dataset

When an Item Label is printed it is already based on an Item/Item Reference.

We will add the fields to the Print Dataset.

Template design

The Standard Label Template Designs has "ExtraInfo"-fields that can be used for displaying additional information from the Dataset.

We will use these fields.


Step 1 - Print the label

Let's begin by printing the label as it is so we can track the changes, as we make them.

Step 2 - Add the data

Using the event OnPrintLabel_OnAfterPopulateDataset, we can add Gross Weight and Warehouse Class Code to the label.


    [EventSubscriber(ObjectType::Codeunit,   Codeunit::"...

    local procedure ..
    begin
     ..
    end;

Available events are:

Update 

Filter by label (Content by label)
showLabelsfalse
max90
showSpacefalse
sorttitle
cqllabel = "bc" and label = "orderlines" and label = "integrationevent" and label = "onaftersetfrom" and ancestor = "47220743"

How it works behind the scenes Is this needed?

XML Response example

Code Block
languagexml
titleXML Response example
<BaseOrderLine xmlns="http://schemas.taskletfactory.com/MobileWMS/BaseDataModel">
 ....
 

 

See also 

UpdateMOB Print", 'OnPrintLabel_OnAfterPopulateDataset', '', true, true)]
    local procedure Ex01OnPrintLabel_OnAfterPopulateDataset(_TemplateName: Text[50]; _SourceRecRef: RecordRef; var _Dataset: Record "MOB Common Element")
    var
        Item: Record Item;
    begin
        // Only relevant for Item labels
        // Item labels are always called with an RecordRef for "Item". Else exit
        if _SourceRecRef.Number = database::Item then
            _SourceRecRef.SetTable(Item)
        else
            exit;

        // Set extrainfo fields and their labels, in the dataset
        _Dataset.SetValue('ExtraInfo01', Item."Gross Weight");
        _Dataset.SetValue('ExtraInfo01_Label', Item.FieldCaption("Gross Weight"));

        _Dataset.SetValue('ExtraInfo02', Item."Warehouse Class Code");
        _Dataset.SetValue('ExtraInfo02_Label', Item.FieldCaption("Warehouse Class Code"));
    end;

Step 3

Verify data is sent to the cloud

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
reversetrue
excerptTypesimple
cqllabel in ("integrationevent",= "example" ) and label = "lineselectionprint"