function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AndegosuAndegosu 

Populate merge fields in documents from Salesforce data

I need to be able to choose from a document template and populate it with Salesforce data. This could be preprocessed documents with merge fields that are already uploaded in Salesforce.

Say I'm in a case record and I choose a document template from a dropdown, I want to download that document with all merge fields populated with data from the case record.

I know this would be possible if you export the documents as html and add them to email templates and just render the html in a visualforce page as pdf or docx. This method seems to be losing the images and some styling of the documents though.

Anyone know how I can do this?
Tanishka AroraTanishka Arora
Any Solution for this?