PDF Document Generation Updates in Dynamics 365 2020 Wave 2 Release
If you are new to PDF document generation in CRM refer my previous introduction blog. The latest 2020 Wave 2 update introduces some interesting updates to this feature.
1. PDF generation capability is now enabled for all the entities (system & custom)
On the Sales Hub app navigate to App Settings -> Productivity Tools where you will find the whole list of entities on which the feature can be enabled.

2. The button has been renamed to ‘Export to PDF’.
Document generation works only for 1 record at a time and at the moment the button is only available on the Entity Form.
With a bit of ribbon customizations, we should be able to get this button the GRID as well, but it would work only for 1 record at a time

3. Clicking the button opens the below window with a much-improved user experience.

4. The PDF generation capability is now exposed as an Action and can now be called via the API as well
Here’s a sample code to generate a PDF document for an invoice template using C#
OrganizationRequest Req = new OrganizationRequest(“ExportPdfDocument”);Req[“EntityTypeCode”] = 1090;
Req[“SelectedTemplate”] = new EntityReference(“documenttemplate”, new Guid(“ea22f936-1033-41dc-9349-cfcffbeee4c8”));
List<Guid> invoiceRecords = new List<Guid> { new Guid(“66d57d7e-e142-4313-8f2b-15b82a685771”) };
Req[“SelectedRecords”] = JsonConvert.SerializeObject(invoiceRecords);
OrganizationResponse Response = dynamicsService.Execute(Req);
Note: Although the ‘SelectedRecords’ property accepts an array, it works only for the 1st record when you pass in multiple values.
This was originally posted here.
*This post is locked for comments