Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

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

Posted on by Microsoft Employee

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

  • Suggested answer
    forid Profile Picture
    forid 25 on at
    RE: CRM 2016 Word Template with values of current user and if condition

    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!

  • mbanker Profile Picture
    mbanker 45 on at
    RE: CRM 2016 Word Template with values of current user and if condition

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

  • sourche Profile Picture
    sourche 10 on at
    RE: CRM 2016 Word Template with values of current user and if condition

    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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CRM 2016 Word Template with values of current user and if condition

    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.

  • LindsayH Profile Picture
    LindsayH 252 on at
    RE: CRM 2016 Word Template with values of current user and if condition

    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!

  • hetal Profile Picture
    hetal on at
    RE: CRM 2016 Word Template with values of current user and if condition

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

    Will downloading DocumentsCorePack help anyhow to achieve the above?

  • Bob Hatcher Profile Picture
    Bob Hatcher on at
    RE: CRM 2016 Word Template with values of current user and if condition

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

  • Inogic Profile Picture
    Inogic 24,094 on at
    RE: CRM 2016 Word Template with values of current user and if condition
    Can you please check following link if that help to resolve your issue.
     
     
    Thanks,
    Sam
  • Bob Hatcher Profile Picture
    Bob Hatcher on at
    RE: CRM 2016 Word Template with values of current user and if condition

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CRM 2016 Word Template with values of current user and if condition

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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans