Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Document Templates on Custom Entity with multiple related (lookup/referential) Contacts

(0) ShareShare
ReportReport
Posted on by 175

I have a custom entity (Entity A) with 3 related Contacts (X, Y & Z).  The Contacts are all defined as Lookup fields.

A Document Template containing details from Entity A and Contact X works fine.

A Document Template containing details from Entity A and Contact Y fails to load details from Contact Y.  No error is thrown.

A Document Template containing details from Entity A and Contact Z fails to load details from Contact Z.  No error is thrown.

Is it possible to use Document Templates reliably in this scenario?  How?

*This post is locked for comments

  • Verified answer
    cymorg Profile Picture
    cymorg 175 on at
    RE: Document Templates on Custom Entity with multiple related (lookup/referential) Contacts

    I found the solution to this - actually I found the problem and fixed it.  It turns out I had a field called FieldX and I also had a relationship called FieldX.  For most things in Dynamics it isn't a problem as the system uses GUIDs to refer to these objects however when you export these to a Document Template it does matter.  My solution was to remove FieldX and recreate it making sure the corresponding relationship had a unique name.  Thanks to everyone for their help on this, it's much appreciated.

  • cymorg Profile Picture
    cymorg 175 on at
    RE: Document Templates on Custom Entity with multiple related (lookup/referential) Contacts

    Syed.  Thanks for the suggestion but I think not.  My custom entity A is loosely coupled to X, Y & Z.  I'm not trying to get from A to X to Y (as I think you suggest), rather I'm trying to get properties of X from A, properties of Y from A and properties of Z from A.  The fact that it partially works suggests it should totally work, but it doesn't.  I showed this problem to a Microsoft support technician and he was flummoxed - he's referred this case to bigger guns.  We'll see what happens.

  • Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: Document Templates on Custom Entity with multiple related (lookup/referential) Contacts

    Hi cymorg,

    You can retrive the values of the direct related entity. for e.g: From account you can retrieve information about contact information. You cant retrieve any child contacts details of the contacts if any.

    to conclude : you can get A-> B not A->B->C

  • cymorg Profile Picture
    cymorg 175 on at
    RE: Document Templates on Custom Entity with multiple related (lookup/referential) Contacts

    I'm not using the repeating content control as there is 1 instance each of X, Y & Z per Entity A.  Therefore there should be no need to repeat anything as, in effect, there is only 1 of everything so repetition should have no effect.  Nevertheless I'll try using a repeating content control and see what happens.

    To make this less generic (more real-world) my Entity A is a "Residential Tenancy".  X is the Landlord, Y & Z are the tenants.  The Landlord and first tenant (Y) are required.  The 2nd tenant (Z) is optional.

  • RE: Document Templates on Custom Entity with multiple related (lookup/referential) Contacts

    Cymorg, are you using the "repeating" content control, or are X,Y, and Z all mapped to different fields?  When I attempt to show multiple contacts related to an opportunity, I right click on the "opportunity_customer_contacts" in the Word XML Mapping pane and select "Insert Content Control" then select "Repeating:". On the body of the document it then reads"Enter any content that you want to repeat, including other content controls. You can also insert this control around table rows in order to repeat parts of a table."   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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans