Enabling Export to PDF Command on Case Entity in Dynamics 365
Dynamics 365 Sales provides the capability to create and share PDF files of the sales entity records. This feature has been expanded in 2020 release wave 2 to support custom entities. We can configure the entities in the Sales Hub app by managing the setting Convert to PDF
However, the documentation doesn't mention how you could configure this for Case entity in the Sales hub app and we cannot find the Case entity in the list. This makes sense as Case is centered more on the Customer Service product.
If we try to check the Customer Service admin center app to see if a similar setting exists, we cannot find this setting.
Does that mean the Case table doesn't have this command? We can quickly validate this by checking the Case modern command bar in the Customer Service Hub app.
The command bar does have the Export to PDF button but it's not being displayed on the Case form. This is expected as the Command checks to see if the Case table is enabled for this functionality before displaying it.
In order to enable this setting, we could look at how the Sales Hub is enabling this setting for other tables. This can be done easily by using the Network tab in the Developer tools when clicking the Save button after selecting the tables we want in the Sales Hub app.
It appears the app is making a Web API request to the pdfsettings entity and passing the below information.
I am going to make a similar request in Postman but include the Case entity in the request body as below. You can refer to this post on how to setup the authentication.
Alternatively, you could just write a simple console app in C# or your preferred language or better yet just use the Bulk Data Updater in the XrmToolBox.
If we now check our Case entity, we should see the Export to PDF command.
While it's not documented anywhere, I believe this would still be under the supported scenario but if in doubt you can check with Microsoft before enabling this in production. Hopefully, this gets addressed sooner and we do not have to continue using this approach.