Note that there are some explanatory texts on larger screens.

plurals
  1. POUse Microsoft Dynamics CRM web service to get customized option set values
    primarykey
    data
    text
    <p>The CRM has some customized option sets, for example, Salutation option set is defined for Contact entity. I need to get values of this option set when creating or updating contacts. I tried to use <code>RetrieveOptionSet</code> request to get the option set values as below:</p> <p>SOAP action to use <code>http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute</code></p> <p>SOAP request body</p> <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Body&gt; &lt;Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;request i:type="a:RetrieveOptionSetRequest" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts"&gt; &lt;a:Parameters xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic"&gt; &lt;a:KeyValuePairOfstringanyType&gt; &lt;b:key&gt;MetadataId&lt;/b:key&gt; &lt;b:value i:type="c:guid" xmlns:c="http://schemas.microsoft.com/2003/10/Serialization/"&gt;00000000-0000-0000-0000-000000000000&lt;/b:value&gt; &lt;/a:KeyValuePairOfstringanyType&gt; &lt;a:KeyValuePairOfstringanyType&gt; &lt;b:key&gt;RetrieveAsIfPublished&lt;/b:key&gt; &lt;b:value i:type="c:boolean" xmlns:c="http://www.w3.org/2001/XMLSchema"&gt;true&lt;/b:value&gt; &lt;/a:KeyValuePairOfstringanyType&gt; &lt;a:KeyValuePairOfstringanyType&gt; &lt;b:key&gt;Name&lt;/b:key&gt; &lt;b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema"&gt;my_type&lt;/b:value&gt; &lt;/a:KeyValuePairOfstringanyType&gt; &lt;/a:Parameters&gt; &lt;a:RequestId i:nil="true" /&gt; &lt;a:RequestName&gt;RetrieveOptionSet&lt;/a:RequestName&gt; &lt;/request&gt; &lt;/Execute&gt; &lt;/s:Body&gt; &lt;/s:Envelope&gt; </code></pre> <p>The problem is that I can only use this request to get global option sets, but for customized option sets, this request just returns a not found error.</p> <p>Does anyone knows how to get customized option set values?</p> <p><strong>EDIT:</strong> I'm using Java client to access Dynamics CRM web service. This is the final SOAP request body I used to successfully get option set values.</p> <pre><code>&lt;s:Envelope&gt; &lt;s:Body&gt; &lt;Execute&gt; &lt;request i:type="a:RetrieveAttributeRequest"&gt; &lt;a:Parameters&gt; &lt;a:KeyValuePairOfstringanyType&gt; &lt;b:key&gt;MetadataId&lt;/b:key&gt; &lt;b:value i:type="c:guid"&gt;00000000-0000-0000-0000-000000000000&lt;/b:value&gt; &lt;/a:KeyValuePairOfstringanyType&gt; &lt;a:KeyValuePairOfstringanyType&gt; &lt;b:key&gt;RetrieveAsIfPublished&lt;/b:key&gt; &lt;b:value i:type="c:boolean"&gt;true&lt;/b:value&gt; &lt;/a:KeyValuePairOfstringanyType&gt; &lt;a:KeyValuePairOfstringanyType&gt; &lt;b:key&gt;EntityLogicalName&lt;/b:key&gt; &lt;b:value i:type="c:string"&gt;contact&lt;/b:value&gt; &lt;/a:KeyValuePairOfstringanyType&gt; &lt;a:KeyValuePairOfstringanyType&gt; &lt;b:key&gt;LogicalName&lt;/b:key&gt; &lt;b:value i:type="c:string"&gt;my_type&lt;/b:value&gt; &lt;/a:KeyValuePairOfstringanyType&gt; &lt;/a:Parameters&gt; &lt;a:RequestId i:nil="true"/&gt; &lt;a:RequestName&gt;RetrieveAttribute&lt;/a:RequestName&gt; &lt;/request&gt; &lt;/Execute&gt; &lt;/s:Body&gt; &lt;/s:Envelope&gt; </code></pre> <p>The sample code in <a href="http://msdn.microsoft.com/en-us/library/gg594428.aspx" rel="nofollow">this page</a> gave me useful information.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload