Sage CRM 2020 R1:Support for Nested Mail Merge extended. (Part 3 of 3)

This is the third of three articles that explains the new extended support for Nested Mail Merge templates in Sage CRM 2020 R1.

The articles will
I have explained in the first article within the series that nested mail merge is possible because of definitions placed in the metadata.  The merge relationship is defined in the MailMergeRelatedInfo table. The rows in the link the parental entity with the child and defines which view the child record should use and the foreign key that links the child to the parent.​
If you have create the required definitions in the MailMergeRelatedInfo table then we can create a new mail merge template.  In my example I have been creating a new nested relationship between Company and Cases.

Note:  You are limited to one Child set of data per entity.  If you have linked Company with Cases, you should not then link Company with Opportunities.​

A nest merge template will draw its data from two separate views.

The following views are used for outer merge depending on the parental entity.
  • Company - vMailMergeCompany
  • Person - vMailMerge
  • Opportunity - vMailMergeOpportunity
  • Case - vMailMergeCase
  • Lead - vListLead
The child view will be what ever is defined in MailMergeRelatedInfo.   In my example I entered the following data into MailMergeRelatedInfo.
  • mmri_EntityName: Company
  • mmri_ChildEntity: Cases
  • mmri_ChildView: vListCases
  • mmri_LinkColumn: Case_PrimaryCompanyId
Therefore the views my new template will use These are vMailMergeCompany and vListCases.​

The process of creating a Nest Merge template for the Company and Person tables requires the user to insert special nested regions into the HTML of the template.​
You can see that I have created a new template called company cases.html
The user needs to create the nested section of the template using "Insert Nested Region".  It is strongly recommended that you include the child information, e.g. from the Quote Items, within the structure of a table.​

You can see my template contains a nested region.  Here the template embeds records from the case table.

Once the template is saved it can be used as normal.

The merge document draws information from the Parent (Company) and the Child (Case) table.