Versions Compared

Key

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

Use this event to

Excerpt

Change the data on the selected label just before it is sent to the Cloud Print Service

...

Standard Label Designs


Template

        [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB Print"'OnPrintLabel_OnAfterPopulateDataset''', true, true)]
    local procedure OnPrintLabel_OnAfterPopulateDataset(_TemplateName: Text[50]_SourceRecRefRecordRefvar _DatasetRecord "MOB Common Element" temporary)
    begin
    end;

 

Example 1: Modify labels on Item Label


    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB Print", 'OnPrintLabel_OnAfterPopulateDataset''', true, true)]
    procedure Ex02OnPrintLabel_OnAfterPopulateDataset(_TemplateName: Text[50]; _SourceRecRef: RecordRefvar _Dataset: Record "MOB Common Element")
    begin

        // Making sure we only handle our own Label-Template
        if _TemplateName <> 'Item Label 4x6' then
            exit;

        // Modify labels
        _Dataset.SetValue('UnitOfMeasure_Label''Units');
        _Dataset.SetValue('LotNumber_Label''Batch No. ');
    end;


Example 2: Set extra info fields and their labels


    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB Print", 'OnPrintLabel_OnAfterPopulateDataset''', true, true)]
    procedure Ex03OnPrintLabel_OnAfterPopulateDataset(_TemplateName: Text[50]; _SourceRecRef: RecordRefvar _Dataset: Record "MOB Common Element")
    begin

        // Making sure we only handle our own Label-Template
        if _TemplateName <> 'Item Label 4x6' then
            exit;

        // Set extra info fields and their labels
        _Dataset.SetValue('ExtraInfo01''ExtraInfo01_Value');
        _Dataset.SetValue('ExtraInfo01_Label''ExtraInfo01_Label');

        _Dataset.SetValue('ExtraInfo02''ExtraInfo02_Value');
        _Dataset.SetValue('ExtraInfo02_Label''ExtraInfo02_Label');

        _Dataset.SetValue('ExtraInfo03''ExtraInfo03_Value');
        _Dataset.SetValue('ExtraInfo03_Label''ExtraInfo03_Label');

        _Dataset.SetValue('ExtraInfo04''ExtraInfo04_Value');
        _Dataset.SetValue('ExtraInfo04_Label''ExtraInfo04_Label');
    end;


Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
titleMore examples
excerptTypesimple
cqllabel = "bc" and label = "print" and label = "example"

...