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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2016 Word Template with values of current user and if condition

(3) ShareShare
ReportReport
Posted on by

Hi there,

can anyone answer this two questions:

1) Is it possible the get all the values of the current system_user which is using the Word Template feature?

   For example to insert values like name and phonenumber of the person who created the document.
I can use e.g. the "n:1" entity user connected by lk_contactbase_lastmodified or contact_owning_user, but this is not what i need exatly. 

2) For letter generating it would be nice to use some conditions in Word like in the form letter feature.
E.g. insert blanks after an non-empty field:
    <firstname><secondname>{IF <secondname> <> "<BLANK>" ""}<lastname>

or insert text depending on salutation
   {if <salutation> = "Herr" "Sehr geehrter Herr" "Sehr geehrte Frau"} <fullname>

I've tried the common {if] feature (ALT-F9) but the text filled by the XML-mappings cannot be used for conditions. The values are not filled, just the text of the crm-field can be read inside the if-clause.

Suggestions highly welcome

Folke

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Could anyone respond to these questions? I think they are pretty important features but we can't find any information on this.

  • Bob Hatcher Profile Picture
    on at

    Folke, did you ever come up with a solution for this?

  • Inogic Profile Picture
    748 on at
    Can you please check following link if that help to resolve your issue.
     
     
    Thanks,
    Sam
  • Bob Hatcher Profile Picture
    on at

    Inogic - Your blog covers the basics but the question was how to do conditionals, so no, this does not answer the question.

  • hetal Profile Picture
    on at

    We are also facing the same issue, did anyone find any solution?

    Will downloading DocumentsCorePack help anyhow to achieve the above?

  • LindsayH Profile Picture
    252 on at

    We are also having this issue - has anyone found a resolution?

    I can't believe that Word Templates in CRM 2016 are supposed to have been improved and yet we have lost a major feature!

  • Community Member Profile Picture
    on at

    I am currently working on the same Issue with german Salutations and came up with a different solution. Instead of having the IF-logic inside the Word Template i used a business logic rule inside Dynamics. There you can define a rule for the field "gendercode" of the contact, which fills out a text-field "salutation" depending which gender was selected. Then you just insert the "salutation" field into the Word template and do not have to worry about any logic there.

    Additionally you might want to set the gendercode field as mandatory.

  • sourche Profile Picture
    10 on at

    There is not any solution to use conditions in word templates with xml mapping. 

    Unfortunately you could add conditional statements, barcode generation in mail merge functionality which is deprecated.

    BR,
    Mehmet

  • mbanker Profile Picture
    45 on at

    Has anyone come up with a solution for how to dynamically insert the user name who generated the word doc from the template?

  • Suggested answer
    forid Profile Picture
    27 on at

    I have been battling away with this since the initial announcement was made by Microsoft that mail merges were being deprecated and word templates would be the replacement.

    I have found somewhat of a solution but it isn't perfect and will require some work to be done by users/clients if you're in an organisation.

    In word, there is a mailings tab and you are able to select recipients for a mail merge. Here, click on the Select Recipients drop down and then select Choose from Outlook Contacts.

    A window will appear with the number of contacts in your address book, click OK. Here, you'll see a list of contacts that are added in your outlook.

    At this point, open Outlook and then in the peoples icon, search for your own contact information card. Once you've located your details, click on the three dots and then add yourself as a contact to outlook.

    This is where you'd need to contact the users/clients in your organisation and request them to add themselves as a contact, so that they can pick their contact record when the merge takes place from Dynamics CRM.

    Go back to word and then highlight data source Contacts and hit Refresh. If it doesn't show up, just cancel that window and then try Select Recipients and Choosing Outlook contact again.

    Your details will appear on the bottom. If you have lots of other contact, untick them all and only have your row ticked. Click OK.

    Click on Insert Merge Field and then add the details as required i.e. first name, last name, telephone number, email etc to the template.

    Test that everything works by clicking Preview Results on the top ribbon. Your details should then be populated.

    Save and upload the template to Dynamics CRM and then try it out on the entity.

    Hopefully, the contact information for the current users should generate.

    I hope this helps!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Varsha deshpande Profile Picture

Varsha deshpande 5

#2
JS-09031509-0 Profile Picture

JS-09031509-0 3

#3
Ciprian  P Profile Picture

Ciprian P 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans