Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Retrieving OptionSetValue via Fetch XML Request

$
0
0

Hey All,

I've looked around and found some responses for c# api based and other info but nothing directly for fetch xml requests. I'm retrieving a list of contacts with no issues via the fetch xml on dynamics 2011. I'm retrieving a field which is called dba_title (the contacts title).

The value is an integeger which is obviously a foreign key to a OptionSetValue. I'm still not 100% sure how this works but i'm presuming they are just generalied key value associative entities.All I want to be able to do is retrieve the value of the link instead of the key. Code is below. I've tried a few different linking entites with no luck.

Any thoughts appreciated..

<s:Body><Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services"><request i:type="b:RetrieveMultipleRequest" xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><b:Parameters xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"><b:KeyValuePairOfstringanyType><c:key>Query</c:key><c:value i:type="b:FetchExpression"><b:Query>&lt;fetch mapping="logical" page="'.$page.'" count="'.$count.'" version="1.0" paging-cookie="'.$_SESSION['cookie'].'" &gt;&#xD;&lt;entity name="contact"&gt;&#xD;&lt;attribute name="contactid" /&gt;&#xD;&lt;attribute name="firstname" /&gt;&#xD;&lt;attribute name="lastname" /&gt;&#xD;&lt;attribute name="emailaddress1" /&gt;&#xD;&lt;attribute name="mobilephone" /&gt;&#xD;&lt;attribute name="dba_title" /&gt;&#xD;&lt;attribute name="telephone2" /&gt;&#xD;&lt;attribute name="telephone1" /&gt;&#xD;&lt;attribute name="address1_line1" /&gt;&#xD;&lt;attribute name="address1_line2" /&gt;&#xD;&lt;attribute name="address1_city" /&gt;&#xD;&lt;attribute name="address1_stateorprovince" /&gt;&#xD;&lt;attribute name="address1_postalcode" /&gt;&#xD;&lt;attribute name="address1_country" /&gt;&#xD;&lt;link-entity name="listmember" from="entityid" to="contactid" intersect="true"&gt;&lt;filter type="and"&gt;&lt;condition attribute="listid" operator="eq" value="'.$listId.'" /&gt;&lt;condition attribute="entitytype" operator="eq" value="2" /&gt;&lt;/filter&gt;&lt;/link-entity&gt;&lt;/entity&gt;&#xD;&lt;/fetch&gt;</b:Query></c:value></b:KeyValuePairOfstringanyType></b:Parameters><b:RequestId i:nil="true"/><b:RequestName>RetrieveMultiple</b:RequestName></request></Execute></s:Body>


Viewing all articles
Browse latest Browse all 8223

Trending Articles



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