Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

I need a solution for a word template issue

(0) ShareShare
ReportReport
Posted on by 27

Hi,

I have begun converting our mail merge templates into word templates as part of the mail merge deprecation that will be taking place.

I've come across an issue which I can't seem to resolve, so was hoping someone might be able to help.

In Dynamics 365 CRM, we have a field called Collection/Shipment Date. The format of the field is DD/MM/YYYY - when using the XML pane and adding the field as plain text, it works fine.

The issue is we have a custom ID field which also requires the Collection/Shipment Date, but in a YY format.

So it is GXXXX'YY'0XXXXX.

My first question is as follows.

Q1: Is there a way to make the Collection/Shipment Date appear in YY format when the word template is merged from the record in Dynamics 365 CRM?

I tried using the MERGEFIELD with CTRL/ALT + F9 but that didn't work. It doesn't appear to work for word templates as it does for mail merges.

My second question is as follows:

If this isn't possible, is there a way you can truncate the text on a field after it is merged? For example, we do have another field that has the custom ID mentioned earlier (in full), but that contains a prefix and suffix that won't be required.

i.e. GBXXXXXXGXXXXYY0XXXXXZZZZZZZZZZ. I want to get rid of everything before GX i.e. GBXXXXXX and all of the Zs.

I already posted this question here but couldn't find any answers. https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_win10-mso_2016/change-date-format-field-on-word-template-from/a6c47783-5103-4334-97f0-32bf930aa9d4?messageId=da1c15ad-8257-41ca-bc02-1d50af52dfe3

Thanks,

Forid.

*This post is locked for comments

  • erhan.keskin Profile Picture
    2,253 on at
    RE: I need a solution for a word template issue

    I am just wondering if it is related to the office version or word settings. You may try in another client.

    At the moment, i cannot recommend anything else, but i will when i have any.

  • forid Profile Picture
    27 on at
    RE: I need a solution for a word template issue

    At the point of running the template against the record, when I download a open the word document, the field isn't there and then I click on Enable Macros and then it still isn't there. Up until that point, it seems promising.

    I will have to find another solution as I have been trying this for quite a while now and it simply isn't working for us.

    Do you have any other recommendations?

    Thanks,

    Forid.

  • erhan.keskin Profile Picture
    2,253 on at
    RE: I need a solution for a word template issue

    It seems alright. I just didn't get when fields disappear.

    It shows on my side like 19/09/2018 until i enable the word document, after enabling the word document formula works.

  • forid Profile Picture
    27 on at
    RE: I need a solution for a word template issue

    5008.png

    3806.png

    64627.png

    22220.png

    Hi,

    I have tried both plain and date picker options. The Collection/Shipment date in CRM is 19/09/2018. Following the steps, the date appears as the current date YY i.e. 19 which appears to work.

    The issue is when I upload the document and then run it against the record from CRM.

    I will attach the screenshots now.

  • erhan.keskin Profile Picture
    2,253 on at
    RE: I need a solution for a word template issue

    You can try both plain Text and Date Picker. If you want, share you screenshots with me to see how it is seen.

  • forid Profile Picture
    27 on at
    RE: I need a solution for a word template issue

    Hi,

    Yes, I have actually tried both. I uploaded one template where the field code is showing and another where is it closed i.e. the actually yy format is showing.

    When I try running both templates against the record, it still has the same outcome i.e. GXXXX and nothing after that.

  • erhan.keskin Profile Picture
    2,253 on at
    RE: I need a solution for a word template issue

    My understanding is that you didn't close field codes before uploading the templates, that is why you pressed ALT + F9 after generating the document. Can you upload the file after closing the field codes?

    Make sure you see the field codes like this before closing the field codes.

    { DATE \@ "yy" \* MERGEFORMAT }

    Regards,

  • forid Profile Picture
    27 on at
    RE: I need a solution for a word template issue

    Hi, thanks for your reply.

    Unfortunately, this didn't work. When I uploaded the template and ran it against a record, the collection/shipment date field I had added was removed altogether.

    I pressed ALT + F9 and the other fields on the document showed the values, but not the custom ID. It simply shows GXXXX and that's it.

    Any ideas?

    Thanks,

    Forid.

  • erhan.keskin Profile Picture
    2,253 on at
    RE: I need a solution for a word template issue

    Here how you need to try;

    1- Please add the field as plain text or date picker to the word document.

    2- Select the field by clicking the 3 dots on the box

    3- Go to Insert > Quick Parts > Field

    4- Go to Date in the Field Names box on the left

    5- Populate yy in the Date formats box

    6- Click OK

    (Alt+F9 if you see the formula)

    Now upload the template and test please.

    Let me know if it works, it worked for me.

    By the way, after downloading the word document, if it does not show the date in the new format, check if you see "Enable Editing" button, if you see it, click the button.

    Regards,

  • forid Profile Picture
    27 on at
    RE: I need a solution for a word template issue

    0726.pngAnd this is how it appears when merged from the word template in D365 CRM

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans