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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dynamic Content in Document Templates

(0) ShareShare
ReportReport
Posted on by

Hello, I am playing around with the new Document Template feature for in CRM 2016.  I am easily able to include fields in my documents by inserting the content controls as plain text from xml parts.  One thing that I cannot figure out however is how to add dynamic content using "IF" statements from the values populated from the content control fields.

For example:

If country = USA "This field displays USA" "This field does not display USA".

Has anyone able to do this with Document Templates in CRM 2016?

Thanks in advance!

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Dynamic Content in Document Templates

    Hello Anwesh,

    In this example crmtipoftheday.com/.../conditional-values-in-word-templates the value of total amount field is shown on Word template as a number after generating a template, so the bookmark method can work.

    What Erik and I want to have is a dynamic content in Word template based on content control value. It would be also nice if we could have dynamic content associated with the field that is not shown in the template itself. We want to write a conditional statement in Word template which will check the value of the specified field in CRM and then display some predefined text.

    There are some workarounds, but we would like to solve this in a much more elegant way.

    Is it possible to implement a conditional logic (based on the content control fields, not by using bookmarks) in a template through an If-Else type of statement in the template itself?

  • Community Member Profile Picture
    on at
    RE: Dynamic Content in Document Templates

    In Insert tab-->Quickparts-->fields--> you can add if condition .

    In order to add condition we need to have the book marks .we can create bookmarks in inset tab --> bookmarks

  • Community Member Profile Picture
    on at
    RE: Dynamic Content in Document Templates

    This is good information, but still does not get us all the way there.  The fact that you have to enable editing keeps from full automation of conditional content.

    We have gotten around this by including information from related entities in the template.  Still, it would be nice to be able to control conditional logic in a template 100% through an If-Else type of statement in the template itself.

    Are you listening Microsoft! :)

  • Suggested answer
    Joe Gill Profile Picture
    on at
    RE: Dynamic Content in Document Templates

    Hi Guys,

    As you have discovered there are some limitations with Word Templates.

    This post shows how you can use Word Fields to add conditional formatting

    http://crmtipoftheday.com/2016/08/24/conditional-values-in-word-templates/

    hth

    Joe

  • Community Member Profile Picture
    on at
    RE: Dynamic Content in Document Templates

    I have same issue with Document Template feature in Crm 2016,

    Have you got any solution?

  • Community Member Profile Picture
    on at
    RE: Dynamic Content in Document Templates

    Does anyone have samples of conditional text macros that they have used with the Document Template feature in CRM 2016?  I've been working to try and figure out how this can be done.  Examples from those who have accomplished this already would help a lot.

    Thanks!

  • Soma Shekar Profile Picture
    461 on at
    RE: Dynamic Content in Document Templates

    Hi ,

    Microsoft hasn't provided the IF condition , and  Arithmetic operations on the table.

    Same as 2016 word templates Dynamics Objects implemented  Dynamics Docs  Add-On ,

    This is compatible  from CRM 2011 to CRM 2016

    and you can convert the generated  word template  to PDF file also with one-click

    http://dynamicsobjects.com/Products/Dynamics-Docs

    Dynamics Docs has the  IF Conditions ,  Arithmetic operations like Sum, Average, Count

    and has a great feature like Sub reports.  i.e., you can insert the report(docs templates) of related entities (1:N, N:1 relations ) to the documents.

    and Send an email with attached report (pdf, word )  using workflow.

    and one click to send an email with attachment from ribbon button. 

  • Verified answer
    ScottDurow Profile Picture
    21 on at
    RE: Dynamic Content in Document Templates

    You have two options - either add some conditional macros to the word template or create a calculated field in CRM and add that to the template.

  • Community Member Profile Picture
    on at
    RE: Dynamic Content in Document Templates

    This is great information.  Thank you!

    However, it does not answer my question regarding the ability to display text in the document based on a value of one of the content control values.

    If the field Country is equal to "USA", I want to display on my document "You are a US Citizen".

    If the field Country is not equal to "USA", I want to display on my document "You are not a US Citizen".

    Any thoughts on how I can make that happen?

  • Inogic Profile Picture
    651 on at
    RE: Dynamic Content in Document Templates

    Please refer our blog https://www.inogic.com/blog/2016/02/word-template-feature-in-dynamics-crm-2016/

    Thanks,

    Sam

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans