Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

How to fetch entity result with foreign key.

$
0
0
Bellow the follow code.
{% assign contactId = user.contactid %}
{% fetchxml myentity_Query %}
<fetch version="1.0" mapping="logical">
<entity name="myentity">
<attribute name="myentitytext" />
<attribute name="myentity_contactid" />
<link-entity name="contact" to="myentity_contactid" >
<filter type="and">
<condition attribute="contactid" operator="eq" value="{{ contactId }}" />
</filter>
</link-entity>
</entity>
</fetch>
{% endfetchxml %}
myentity (many to one) contact
use
myentity_contactid link contactid
contactid field is contact entity's primary key.
I cannot load the result with the follow code.
{% for item in myentity_Query.results.entities %}
<div class="item">
{{ item.myentitytext}}
</div>
{% endfor %}

Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>