Featured image of post Hiding the PDF Generation Buttons in Dynamics 365 Sales

Hiding the PDF Generation Buttons in Dynamics 365 Sales

Sometimes, when you find yourself customising Dynamics 365 or a model-driven Power App, you need to go the extra mile in fine-tuning how the interface looks. And while we can use themes or the site map designer to achieve most requirements in this area, it may become necessary to add, remove or modify individual buttons displayed within the application ribbon when a user accesses a dashboard, view or individual record. Doing this can sometimes be easier said than done though; and, as we have seen previously on the blog, these type of changes are something that developers, not functional specialists, may find themselves more comfortable doing. Fortunately, thanks to the Ribbon Workbench tool, a lot of the pain can be taken out of this. And, if for example, you need to remove some specific buttons that display within an entity record form, it’s just a simple case of right-clicking it within the Workbench and selecting the appropriate option:

However, a colleague and I recently came across a situation where this wasĀ not a viable option. Specifically, we were trying to globally hide the following buttons that display on the Quote entity form:

Tried as we might, we couldn’t find a way of locating the appropriate button after digging through the Ribbon Workbench. It just wasn’t there. At this stage, it seemed like the only course of action was to crack open an XML editor and fiddle about with the raw ribbon definition instead to see if we could get the appropriate Hide action implemented. For those who have attempted this previously, I’m sure you’d agree that this is not something you’d readily recommend. Based on this and thinking perhaps that this was not an isolated issue for us alone, we did some research. We came across the following post on the Dynamics 365 communities site, which was incredibly illuminating. It turns out Dynamics 365 controls the visibility of these buttons as part of an application-level setting which is dead easy to switch off completely. All we needed to was to do was navigate across to the App SettingsĀ ->Ā OverviewĀ area of the application, and click on theĀ ManageĀ button on theĀ Convert to PDFĀ option:

As we then see, we can enable/disable the functionality for most of the core entities within the Sales module:

With that done and dusted, the Quote form will no longer display these two buttons any more:

Now, keep in mind, this will disable the described functionality across the whole entity. So if we did need to show/hide the button based on some kind of logic, I think your only remedy is to go into the XML itself and manually customise the Enable or Display rules applied against the following buttons:

  • Mscrm.Form.quote.EmailAsPDF
  • Mscrm.Form.EmailAsPDF.Populate.Flyout
  • Mscrm.Form.quote.CreatePDF

However, attempt this at your own risk. From looking at how Microsoft has hooked up the various commands to these buttons, you have every chance of getting yourself into a complete mess, and I suspect that a future upgrade by Microsoft could wipe any changes you make. Better, I think, to simply use the settings above to disable the functionality altogether, if that is your ultimate end goal. šŸ™‚

comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy