Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Word Template - Get Data from second level entity

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

  • Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: Word Template - Get Data from second level entity

    Good to know Mohit :)

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

    Thanks

  • Mohit Patel Profile Picture
    Mohit Patel 25 on at
    RE: Word Template - Get Data from second level entity

    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

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Word Template - Get Data from second level entity

    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
    Mohit Patel 25 on at
    RE: Word Template - Get Data from second level entity

    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

  • Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: Word Template - Get Data from second level entity

    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

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Word Template - Get Data from second level entity

    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
    Henry J. 5,237 on at
    RE: Word Template - Get Data from second level entity

    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

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans