web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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

I have the same question (0)
  • erhan.keskin Profile Picture
    2,253 on at

    Hi,

    For the first question; Does it not work if you add the field as Date Picker and change the Date Picker properties? (Developer > Properties, "Display the date like this" box on Content Control Properties)

    Regards,

  • forid Profile Picture
    27 on at

    7823.pngHi,

    No, unfortunately it doesn't work. It still contains DD/MM/YYYY in the custom field.

    Thanks,

    Forid.

  • forid Profile Picture
    27 on at

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

  • erhan.keskin Profile Picture
    2,253 on at

    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

    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

    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

    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

    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

    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

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans