Monday, 15 February 2016

fetchXml with pagination XML

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
      <request i:type="a:RetrieveMultipleRequest" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
        <a:Parameters xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
          <a:KeyValuePairOfstringanyType>
            <b:key>Query</b:key>
            <b:value i:type="a:FetchExpression">
              <a:Query>&lt;fetch version='1.0' mapping='logical' output-format='xml - platform' page='1' count='20'&gt;&lt;entity name='account'&gt;&lt;attribute name='name' /&gt;&lt;attribute name='emailaddress1' /&gt;&lt;/entity&gt;&lt;/fetch&gt;</a:Query>
            </b:value>
          </a:KeyValuePairOfstringanyType>
        </a:Parameters>
        <a:RequestId i:nil="true" />
        <a:RequestName>RetrieveMultiple</a:RequestName>
      </request>
    </Execute>
  </s:Body>
</s:Envelope>


<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
      <request i:type="a:RetrieveMultipleRequest" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
        <a:Parameters xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
          <a:KeyValuePairOfstringanyType>
            <b:key>Query</b:key>
            <b:value i:type="a:FetchExpression">
              <a:Query>&lt;fetch version='1.0' mapping='logical' output-format='xml-platform' paging-cookie='&amp;lt;cookie page=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;accountid last=&amp;quot;{377B3F1F-1DB9-E511-80DE-3863BB2E4DA0}&amp;quot; first=&amp;quot;{0F7B3F1F-1DB9-E511-80DE-3863BB2E4DA0}&amp;quot; /&amp;gt;&amp;lt;/cookie&amp;gt;' page='2' count='20' &gt;&lt;entity name = 'account'&gt;&lt;attribute name='name' /&gt;&lt;attribute name='emailaddress1' /&gt;&lt;/entity&gt;&lt;/fetch&gt;</a:Query>
            </b:value>
          </a:KeyValuePairOfstringanyType>
        </a:Parameters>
        <a:RequestId i:nil="true" />
        <a:RequestName>RetrieveMultiple</a:RequestName>
      </request>
    </Execute>
  </s:Body>
</s:Envelope>

No comments:

Post a Comment