Formatting date and time fields in a mail merge for Microsoft Dynamics CRM 2013

By - July 1, 2014

The mail merge feature in Microsoft Dynamics CRM  2013 allows users to automatically add the names, addresses, and other information from records stored in Dynamics CRM directly into letter or envelope templates for mass mailings. A common issue with Mail Merges executed from Dynamics CRM 2013, however, pertains to date fields. Any date field included in the merge will automatically export in the “MM/DD/YYYY HH:MM AM/PM” format, despite the field being configured to display “Date Only” in Dynamics CRM.

While technically accurate, this default format is not typically the desired outcome for the letter.

LKurt1_CRM 2013 Mail Merge

Within Dynamics CRM there are merge codes that can be used to format the exported data while executing a mail merge. Changes to the merge codes must be made in the mail merge template, then re-loaded into CRM.

  1. In Dynamics CRM 2013, navigate to the mail merge templates by clicking the Templates tile under the Settings Nav Bar.
    LKurt2_CRM 2013 Mail Merge
  2. Select the Mail Merge Templates option.
  3. Select the template to edit from the list by double clicking on the row.
  4. Select Edit Template in Word from the ribbon.
  5. Select Open from the security pop-up box.
  6. The template will open in Microsoft Word in Protected View. Click the Enable Editing button in the yellow ribbon at the top of the document.
  7. Open the Add-Ins tab in the ribbon, and click the CRM button.
    LKurt3_CRM 2013 Mail Merge
  8. The Mail Merge Recipients window will open. Click OK.
  9. You may now begin editing the document. Right-click on the date field that needs to be formatted, and select Toggle Field Codes from the drop-down list.
    LKurt4_CRM 2013 Mail Merge
  10. The field will change from looking like «GL_Post_date» to {MERGEFIELD GL_Post_date}
  11. Edit the field so it looks like this: {MERGEFIELD GL_Post_date @ “MMMM D, YYYY”}
  12. Repeat Steps 9-11 as necessary to other date fields in the merge.
  13. Once all date fields have been modified, save the template. If a copy of the template already exists on your computer, consider naming the new copy the same name as the previous copy. The new copy will overwrite the existing copy, and eliminate any chances of redundancy or accidentally uploading the old copy.
  14. In Dynamics CRM, the template window should still be open. Click the Remove button at the bottom of the window to remove the current file.
    LKurt5_CRM 2013 Mail Merge
  15. Click the Browse button next to the now empty File Name field, then select the updated template file from your computer.
  16. Once the file has been selected, click Attach.
  17. Click Save and Close in the ribbon.

The date fields have now been configured to display date only in the merges.

LKurt6_CRM 2013 Mail Merge

Other formatting options for the date, such as “MM/DD/YYYY” are also available:

LKurt7_CRM 2013 Mail Merge

The formatting codes may be inserted in the merge fields in almost any combination, but must be proceeded by “@” to be effective.

If you are looking for support for Microsoft Dynamics CRM, our professionals can help.  We offer services from basic out of the box to complex architecture.  Contact our professionals at crm@mcgladrey.com to learn more.

Read more articles on the new release of Microsoft Dynamics CRM 2013.

By: Lindsay Kurt – Minnesota Microsoft Dynamics CRM partner

Receive Posts by Email

Subscribe and receive notifications of new posts by email.