I am trying to create an order view using fetchxml to bring back the last 5 orders created. (This will be used on account sub-grid form). However this does not seem to be working. Am I missing something in the code below?
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" count="5">
<entity name="salesorder">
<attribute name="name" />
<attribute name="totalamount" />
<attribute name="requestdeliveryby" />
<attribute name="new_customerpo" />
<attribute name="createdon" />
<order attribute="createdon" descending="false" />
<filter type="and">
<condition attribute="statecode" operator="ne" value="2" />
</filter>
<attribute name="salesorderid" />
</entity>
</fetch>
</fetchxml>