Versions Compared

Key

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

Use this event to

Excerpt

Modify the Dataset after it has been populated with context and collected step values

Description

Should you want to modify the data of a label template (standard or custom) you can do it with this event.

  • Make sure you are only handling the desired template.
  • Use GetValue/SetValue to modify the dataset.    
  • All the values in the dataset are sent to InterForm by default.

Please inspect the Label Templates for available fields and labels to modify.

 
Template

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

Example

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB Print"'OnPrintLabel_OnAfterPopulateDataset''', true, true)]
    procedure MyOnPrintLabel_OnAfterPopulateDataset(_TemplateNameText_SourceRecRefRecordRefvar _DatasetRecord "MOB Common Element" temporary)
    begin



        // Making sure we only handle our own Label-Template
        if _TemplateName <> 'My custom Label-Template' then
            exit;

        // Read the Item No. from Dataset and change it 
        // Item No. could have been collected or transferred from ”context”/source table, where the print action was selected by the user 
        if _Dataset.GetValue('ItemNo''ItemA' then
            _Dataset.SetValue('ItemNo''ItemB');

        // Change the some labels
        _Dataset.SetValue('UnitOfMeasure_Label''Units');
        _Dataset.SetValue('LotNumber_Label''Batch No. ');

        // 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"

  


Version History

VersionChanges
MOB5.16Introduced





Standard Label Templates

Child pages (Children Display)
pageLabel Templates


Standard Templates Handlers

Child pages (Children Display)
pageTemplate Handlers