Adding more details to single column of mail merge templates

By | April 6, 2012

Exporting screen details to different word templates is one of the essential features of any business software. In our day to day business we come across many scenarios where we need to export the details to predefined word document template so that we can send the same by post or hand over printed copy to customer. The most common scenario of such workflow is the Quotations. We can create Quotes in CRM and export the same to word templates using Export to Word button available on the summary screen.

You can see that the Product name is coming up in one of the columns of the mail merge template. I came across the requirement where we needed to have Product Description as well as custom Note field we had added for entering notes for items added in same column of the quote items table. i.e. in product column I must get something like “Product Name (Note)”
At first look it looks very much straight forward just to go ahead and add one more column in merge fields of template to make it work however due to looping happening in the table it doesn’t work. Then how do we go about achieving this behavior? Follow the below steps.
1. Go to Administration  Customization.
2. Select QuoteItems.
3. Click on Views tab.
4. Click on the hyperlink of view named vLineItemsQuote.
5. Change the standard view to the one as following.
CREATE VIEW vLineItemsQuote AS SELECT ltrim(rtrim(prod_description))+'(‘+ltrim(rtrim(quit_note))+’)’ as ProductNote,QuoteItems.*, NewProduct.* FROM QuoteItems LEFT JOIN NewProduct ON QuIt_ProductID = Prod_ProductId WHERE QuIt_Deleted IS NULL
6. Then go to C:\Program Files\Sage\CRM\\Library\Global Templates\US.
7. Open your quote template by double clicking it.
8. Add the new created column ProductNote to template as shown below and save the template.

9. Now go to quote summary and again do Export to word using above mentioned template. You will see the newly added details as planned.