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)

Word Template - Get Data from second level entity

(0) ShareShare
ReportReport
Posted on by 25

Hi All,

I downloaded word template after selecting entity and its mapping.

Now I want to have further mapping of second level entity fields but I am not able to do that using existing functionality.

For Example:

I created Template for Account entity with relationship to Contact Entity.

Now I have another lookup in Contact Entity for "ABC" Entity.

I want few columns of "ABC" entity in my word template.

Can someone suggest whether this is possible or not?

Thanks,

Mohit Patel

*This post is locked for comments

I have the same question (0)
  • Henry J. Profile Picture
    5,237 on at

    Hi Mohit!

    This might be possible. Have you checked that article?

    www.crmsoftwareblog.com/.../word-document-templates-that-use-fetchxml-for-complex-data-retrieval

    Henry

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Very possible.

    In Settings -> Templates. Se;ect New Template.

    Click on the New button to create a new template, and select the Primary Entity.

    On the next screen, you have the option to select the 1:N, N:1 or N:N relationship with that entity.

    Select the relationship that you need and download the template.

    Open the Word Document that you downloaded.

    In the Developer Tab in Microsoft Word, click on XML Mapping Pane.

    In the XML Mapping Pane, in the Custom XML Part drop down, select the Primary Entity.

    This will populate your pane,

    There will be a treeview where the primary entity will be the top level of the tree view.

    Click on the arrow next to the primary entity to expand it.

    You can enter the fields on the form by Right clicking on them and selecting the control.

    If you scroll all the way to the bottom of the list, you will see the related entities:

    You can right click on the related entity and select add Repeating Control.

    Within that control you can add controls for the fields of your child entity.

    Hope this helps.

  • Henry J. Profile Picture
    5,237 on at

    Thanks Aric! I misread the initial problem, I thought the need was to display data that was further away. Indeed out-of-the-box word template customization should do it

  • Mohit Patel Profile Picture
    25 on at

    Hi Aric,

    Much appreciate your efforts for writing your comments in details.


    Small problem is I need one more level of mapping other than what CRM OOTB functionality provides.

    When I create new template and after selecting primary entity, next screen will display to select different relationships.

    For my previous example, my Primary Entity is Account.

    And in relationship screen I am selecting Contact as N:1 relationship.

    Till now everything looks good and working fine.

    Now I have one more custom entity which is associated to Contacts and not with Accounts.

    I need that custom entity field values in my template too.

    In relationship screen, I will be able to select only those mappings which are associated to Account.

    So this custom entity will not be part of available relationship list for Account.

    Please let me know if you need more details.

    Thanks,

    Mohit Patel

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    This is much more complicated, however I still think it is possible though I have no tried it to the extent that you are looking.

    Word document templates also support the creation of documents using fetchXml, same as reports.

    I am attaching a couple of links that might help you resolve the issue, but they will be more time consuming than the OOTB features.

    www.crmsoftwareblog.com/.../word-document-templates-that-use-fetchxml-for-complex-data-retrieval

    dynamicsuser.net/.../word-document-templates-that-use-fetchxml-for-complex-data-retrieval

    I hope this helps you out.

  • Mohit Patel Profile Picture
    25 on at

    Hi Aric,

    It will be too much time consuming stuff and seems much more complicated.

    I managed my requirement by creating new field in Account Entity and I am updating that field value on Creation of Contact and update of Contact record.

    This will make my life easy. :)

    Thanks gentlemen for all your efforts.

    Keep posted if you find any reasonable solution which works fine meanwhile as a workaround I am using the way I explained.

    Thanks,

    Mohit Patel

  • Henry J. Profile Picture
    5,237 on at

    Good to know Mohit :)

    Don't hesitate to mark our replies as "answers"

    Thanks

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