Reputation: 7289
I am trying to load a field in the Document Template. Below is my scenario
I have Contracts linked to Opportunity (N:1). There is a contact lookup field in the Opportunity
When I generated the Document Template, I selected all 1:N, N:1 & N:N relations, but I don't get the details of Contact field under new_Opportunity_new_contract (relation)
In the Document Template of Contracts, I need to pull the Contact Name from the lookup field in Opportunity.
Is it possible to get that?
Upvotes: 0
Views: 1787
Reputation: 530
I assume that you are trying to create a Word Document Template.
After going to Settings -> Templates -> Document Templates and clicking New, you have to select 1.Word Template and 2.Contract, then click Select Entity:
When the relationship selector popup appears select the opportunity to contract relationship that you have created and click Download Template:
A word document will be downloaded to your computer, open it. Then, click in the Developer tab (if it does not show up go to File -> Options -> Customize Ribbon and in the right Select the Developer tab).
Then 1.Click the XML Mapping Pane which will open a pane in the right side of your monitor. 2.At the top of the Pane there will be a picklist where you have to pick the option which starts with urn:microsoft. 3.Scroll down until you see the relationship you have created between opportunity and contract and expand it:
Search for a field with the name "yourlookupid" + "name" at the end. Right click it to add to the form, click Insert Content Control and Plain Text:
Finally, go back to Dynamics and upload your word template file by clicking Upload Template in the templates view.
Reminder don't forget to enable the security roles for your users as well ;)
Upvotes: 1
Reputation: 5531
I Went through your exact requierement, I have a followup question, Do you really have to go From Contract--> Opportunity--> and then Contact. Because when I check in Contract Entity you will find two N:1 Relation from Contract To Contact
These 2 Relationship will also give you Contact Details information on Document Template.
But if you wish to go from Contract--> Opportunity--> and then Contact then this is not possible in Word Template as you are trying to Reach 3rd level of Relationship
Below are few Screenshots from my Word Template Example for Contract
Upvotes: 1