Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Use this event to

Add/change steps for a template.

Description

When a template is printed you can have additional values collected using Steps.

New steps can be added or existing ones changed.

 

Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB Print", 'OnLookupOnPrintLabel_OnAddStepsForTemplate''', true, true)]
    procedure OnLookupOnPrintLabel_OnAddStepsForTemplate(_TemplateName: Text[50]var _Steps: Record "MOB Steps Element"; var _DatasetRecord "MOB Common Element")
    begin
    end;

 

Example

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB Print"'OnLookupOnPrintLabel_OnAddStepsForTemplate''', true, true)]
    procedure MyOnLookupOnPrintLabel_OnAddStepsForTemplate(_TemplateNameText[50]; var _StepsRecord "MOB Steps Element"var _DatasetRecord "MOB Common Element")
    var
        Item: Record Item;
    begin


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


        // Collect additional Steps

        // Check if Item No. is already collected/transferred to Dataset
        if Item.Get(_Dataset.GetValue('ItemNo')) then

            // Show an information step
            _Steps.Create_InformationStep(10'InfoStep''Information''''You are printing with Item:' + Item."No.")

        else
            // Collect the Item No.
            _Steps.Create_TextStep_ItemNumber(10);

        // Collect which printer to print to
        _Steps.Create_ListStep_Printer(80CopyStr(_TemplateName150));

        // Collect the number of labels
        _Steps.Create_DecimalStep_NoOfLabels(90);

    end;


More examples

  


Version History

VersionChanges
MOB5.16Introduced



Label Templates

Unable to render {children}. Page not found: Label Templates.


Templates Handlers

Unable to render {children}. Page not found: Template Handlers.

  • No labels