UI policy and client scripts are not triggered for Printer friendly version (sysparm_media=print): hidden fields can be visible and error messages occur on the console: Uncaught TypeError: g_form._getVisibleControls is not a function
Steps to Reproduce
Go to incident.list or change_request.list.
Go to the context menu and choose Configure > UI policy.
Create a UI policy to hide a configuration item on the incident form .
Create a UI policy to hide conflict status and conflict last run on change_request form.
Open any existing incident/change request.
Click the gear icon in the upper right of the banner and choose Printer friendly version.
Instead of showing the form in a PDF type format with the same fields visible on the form, all the hidden fields appear on the form.
Upload the attached global sys_ui_script to to temporarily alleviate the error and override specific private client-side functions in the print template.
Related Problem: PRB1292056