Description
Skip collecting printer name
Use case
If you can determine the printer based on label template name, context, user name, etc. then you may skip collecting printer-step
Modify the printer step
We hide the step and set a default value.
This way, the value is set, but the user will not be prompted.
// [Example] Hide printer step, instead of collecting the value, set a (hidden) default value
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB Print", 'OnLookupOnPrintLabel_OnAfterAddStepForTemplate', '', true, true)]
procedure MyOnLookupOnPrintLabel_OnAfterAddStepForTemplate(_TemplateName: Text[50]; _SourceRecRef: RecordRef; var _Step: Record "MOB Steps Element"; var _Dataset: Record "MOB Common Element")
var
MobPrinter: Record "MOB Printer";
begin
// Making sure we only handle relevant label templates
if not _TemplateName.Contains('3x2') then
exit;
// Find the printer to use
MobPrinter.FindFirst();
// Set defaultValue and hide printer-step
if _Step.Get_name() = 'Printer' then begin
_Step.Set_defaultValue(MobPrinter.Name);
_Step.Set_visible(false);
end;
end;
See also
-
How-to: Modify steps on a label-template (Cloud Print) — Modify collected steps before a Label-template is printed.
-
How-to: Add new/Copy a label-template (Cloud Print) — You want to add/create a custom label template with a unique design
-
How-to: Add data to label-template (Cloud Print) — You want to modify a label template by adding data to it
-
Cloud Print: How to modify label-template and add data — In this video, you will be introduced to modifying the design of a label template, using the designer, and adding data using AL code.
-
Cloud Print: How to modify label-template — In this video, you will be introduced to modify the design of a label-template, using the designer.
-
Cloud Print: How to Copy a Label-Template to New — In this video, we will make a copy an existing label-template
-
Case: Print your own ZPL labels (Cloud Print) — Print your own ZPL labels
-
Case: Print muliple labels with unique lot numbers (Cloud Print) — Option to generate and print multiple unique labels
-
Case: Print Label on Tote Shipping Posting (Cloud Print) — Print Label on the posting of Tote Shipping.
-
Case: Print Label on Planned Function Posting (Cloud Print) — Print Label on Planned Posting, i.e. Receive, Pick, Put-away, Ship, Move etc.
-
Case: Print Customized License Plate Contents label (Cloud Print) — Modify the column and lines on License Plate Contents.
-
(Legacy) Case: Print muliple labels with unique lot numbers (MOB5.23-MOB5.38) — Option to generate and print multiple unique labels