Filtering printers on the user name or other criteria

You can filter the list of direct printers based on the user name or any other criteria. This is possible with an integration event. The event receives the direct and local printer names and determines if the printer should be removed from the list of available printers.

Here is the definition of the event:

    [IntegrationEvent(false, false)]
    localprocedureOnFilterDirectPrinters(CloudPrinterName: Text; LocalPrinterName: Text; var RemoveFromList: Boolean)

This is an example of how to use it:

    [EventSubscriber(ObjectType::CodeUnit, Codeunit::"ForNAV Local Printers", 'OnFilterDirectPrinters', '', false, false)]
    local procedureOnFilterDirectPrinters(CloudPrinterName: Text; LocalPrinterName: Text; varRemoveFromList: Boolean)
        if CloudPrinterName 'P' then RemoveFromList := true;

The sample will remove any direct printer with a name greater than P from the list.

Requirements: Customizable Report Pack or newer
Creation date: 2/14/2024 3:46 PM      Updated: 2/29/2024 1:48 PM