Restrict printer based on report setup in Dynamics 365 Finance and Operations

Few weeks back I came across a requirement where client wanted to restrict cheque printer only for cheque reports. So whenever user is trying to send normal report to cheque printer they should get an error.

In order to achieve this

1. We added a check box to cheque printer setup to mark printer as cheque printer.


2. Created a new form for Cheque report setup.

3. Added below for cheque report validation. 

 

How to find report format from Print Management settings

Below is the sample x++ code which will loop thru the Print Management Hierarchy and return the report design configured in setup.