Quantcast
Channel: FORNAV
Viewing all articles
Browse latest Browse all 372

Override printer selection with an event

$
0
0

In situations where the normal use of the Printer Selection page is not enough to select the right printer for the current user, there is an event to help you override the printer selection.

It is a standard event that is called before the request page is shown.

The following code is an example of how to subscribe to the event:

codeunit 50000 "Override Printer Selection"
{
    EventSubscriberInstance = StaticAutomatic;

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Reporting Triggers",
        'GetPrinterName', '', true, true)]
    Procedure GetPrinterName(ReportID: Integer; var PrinterName: Text[250])
    begin
        PrinterName := 'Workstation 1';
    end;
}

Alternatively, you can use the OnAfterGetPrinterName event in the codeunit ReportManagement.

The post Override printer selection with an event appeared first on ForNAV.


Viewing all articles
Browse latest Browse all 372

Trending Articles