Friday 30 September 2011

Return all attributes without having to list them all in the query

Sometimes you might want to return all attributes on an entity without having to list every single one of them in the FetchXML, to do this is very simple in FetchXML, just add in <all-attributes /> where you would normally add in the attributes. If you have a linked entity then you need to add this into the linked entity as well otherwise it will only bring back the primary entities fields.

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
   <entity name='account'>
      <all-attributes />
      <filter type='and'>
         <condition attribute='createdon' operator='today' />
      </filter>
   </entity>
</fetch>

No comments:

Post a Comment

ADFS Timeout on Server 2012 for CRM 2011

This follows on from this Microsoft Guide http://social.technet.microsoft.com/wiki/contents/articles/7681.setting-the-adfs-timeout-for-crm...