Group-based Printer Selection
Info
This function is available from version 18.12 of the 365 business Print Agent.
Please make sure that you are using the latest version.
Group-based printer selection allows you to assign printers to users based on their security groups. This enables you to manage printers for groups of users instead of configuring each user individually.
What is Group-based Printer Selection?
Group-based printer selection extends the standard printer selection by adding a layer where printers can be assigned not only to individual users or reports, but also to user groups.
- User-specific assignments take precedence over group assignments.
- Report-specific assignments (for a specific report) take precedence over general assignments (without a report).
- Group assignments apply to all members of the assigned security group.
How does Group-based Printer Selection work?
The group-based assignment is handled by codeunit bdev.PrA Group Printer Sel. (5523825), which is automatically invoked during the print process. It checks:
- Whether group-level assignments are applicable (no explicit user-report printer exists)
- The security groups the current user is a member of
- The printer assignments for those groups (by report ID, then generally)
The logic is as follows:
- Check if the user is a member of any security group.
- Search for a printer assignment for the group with the current report ID.
- If no report-specific printer is found, check for general group printer assignments (Report ID = 0).
- The found printer name is used if it exists.
Prerequisites
- Microsoft Dynamics 365 Business Central (BC22 or later)
- 365 business Print Agent version 18.12 or later
- Users must be members of at least one security group
Usage
Group-based printer selection is automatically applied during print operations. No manual configuration on the printer selection page is required.
Assignment is done via table "bdev.PrA Group Printer Sel.", which is maintained through AL development or import tools.
Example: Assign a printer to a security group
| Group Code | Report ID | Printer Name |
|---|---|---|
| SALES-DEPT | 100 | HP-LaserJet-100 |
| SALES-DEPT | 0 | HP-LaserJet-All |
- Users in the
SALES-DEPTsecurity group will useHP-LaserJet-100when printing report 100. - For all other reports, they will use
HP-LaserJet-All.
Background
The feature uses Business Central's standard event subscriber logic:
Code
The event subscriber is called after the standard printer selection and replaces the printer name if a group assignment exists.
Technical Details
- Object ID: Codeunit 5523825 "bdev.PrA Group Printer Sel."
- Event Subscriber:
ReportManagement.OnAfterGetPrinterName - Table:
bdev.PrA Group Printer Sel.(5523825) - Security: The codeunit checks Read permissions for the group table.


