Wednesday, October 14, 2015

Retrieve all attributes using FetchXML in MS CRM




Below code snippets gives an example on how to retrieve all the attributes from an entity using fetch xml.

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' count='1'>
  <entity name='new_account'>
    <all-attributes />
    <order attribute='createdon' descending='true' />
    <filter type='and'>
      <condition attribute='new_name' operator='eq' value='Test' />
    </filter>
  </entity>

</fetch>

<all-attributes />  will fetch you all attributes in fetch XML.








No comments:

Post a Comment