Use this event to
Modify properties for any single step for that was added to print label templates.
See also: OnLookupOnPrintLabel_OnAddStepsForTemplate
Description
This event is executed once for every step added from standard Print Label as custom Print Label steps.
You may use this event to change any property of the step or hide the step.
Template
// [Template]
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB Print", 'OnLookupOnPrintLabel_OnAfterAddStepForTemplate', '', true, true)]
procedure OnLookupOnPrintLabel_OnAddStepsForTemplate(_TemplateName: Text[50]; _SourceRecRef: RecordRef; var _Step: Record "MOB Steps Element"; var _Dataset: Record "MOB Common Element")
begin
end;
Example
// [Example] Change an existing step : Add item description to existing InfoStep helpLabel
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB Print", 'OnLookupOnPrintLabel_OnAfterAddStepForTemplate', '', true, true)]
procedure OnLookupOnPrintLabel_OnAfterAddStepForTemplate(_TemplateName: Text[50]; _SourceRecRef: RecordRef; var _Step: Record "MOB Steps Element"; var _Dataset: Record "MOB Common Element")
var
Item: Record Item;
NewHelpLabel: Text;
begin
// Making sure we only handle our own Label-Template and intended step
if (_TemplateName <> 'My custom Label-Template') then
exit;
if _Step.Get_name() = 'InfoStep' then
if Item.Get(_Dataset.GetValue('ItemNo')) then begin
NewHelpLabel := _Step.Get_helpLabel() + ' ' + Item.Description;
_Step.Set_helpLabel(NewHelpLabel);
end;
end;
More examples
-
Case: Default total RunTime based on produced quantity in Production Output — A customer wants the RunTime step for Production Output to be populated with a default value.
-
How-to: Online Validation for Line step — Online Validation on Steps can instantly validate the user data, with a call to BC.
-
How-to: Online Validation for Unplanned Step — "onlineValidation" on Steps can instantly validate the entered data, with a call to the back-end
-
How-to: Production Output - Implement a Unit of Measure step — For Items with multiple Unit of Measure codes
Version History
Version | Changes |
---|---|
MOB5.19 | Introduced |