Question

I have a mail merge template, which includes a bunch of information about the entity that it is associated with in CRM. However, I'm needing a way to add all of the child records from my main entity in to the mail merge template as well.

Is there a way to have a sub record set inside a template?

Was it helpful?

Solution

The easiest solution might be Invantive Composition by inserting a <invantive:foreach>...</invantive:foreach> or through insert building block in the ribbon (note that I work there, but there is also a free version). Alternative solution I've used in the past are programming it completely (using RTF generation outside of Word or VBA or VSTO in Word). But this is quite hard to get right for tables. When the amount of sub records is somewhat limited, you might use PIVOT (see this for example) to change it all into one big record and insert the fields in your document. In the document you may need to hide all placeholders for the sub records not present in a specific instance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top