0

In my Dynamics 365 Customer Engagement cloud implementation I want to use standard "Export to PDF" feature. But first, I would like to intercept and modify the data that is being merged into template.

Is there a plugin message I can use for that?

I tried using Retrieve and RetrieveMultiple on quote and quotedetail. I found out those are not used in document generation.

skfd
  • 2,528
  • 1
  • 19
  • 29

1 Answers1

1

There is no Plugin message that can be utilized to manipulate data in Document generation.

Alternate solution is to utilize a custom button and do necessary manipulation of data in Dataverse & save and initiate generation of Document.

Sample web api calls to export pdf using JS are given below

https://www.richardawilson.com/2021/06/enable-export-to-pdf-button-ribbon.html

https://2die4it.com/2019/08/20/generate-pdf-from-document-templates-in-cds-dynamics-365-ce-using-native-web-api-with-flow/

Harinarayanan
  • 375
  • 1
  • 9
  • 1
    Yeah, I ended with a plugin that re-creates QuoteDetails in Quote activation in correct order. Thanks for confirming mail merge is not accessible as a plugin message – skfd Jun 26 '23 at 13:41
  • I also tried generating templates in Power Automate from custom template + custom ribbon button. But I don't like is PA is very very slow – skfd Jun 26 '23 at 13:42
  • The webapi should be invokable from a javascript similar to any dataverse request using xmlhttprequest with a correct body. I would give that a try and invoke from button click directly. – Harinarayanan Jun 26 '23 at 15:35