Search code examples
reporting-servicesdynamics-crm-2011fetchxml

How to get those Record whose Activity Created or Change in last 24 hours in CRM


I am creating CRM 2011 Fetch-xml Report and want to get those contact whose activity has been change or created in last 24 hours. how can I do that.


Solution

  • Start by retrieving all contacts, then inner join onto activities, then add a condition to only get those activities modified in the last 24 hours.

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
      <entity name="contact">
        <attribute name="fullname" />
        <attribute name="telephone1" />
        <attribute name="contactid" />
        <order attribute="fullname" descending="false" />
        <link-entity name="activitypointer" from="regardingobjectid" to="contactid" alias="ac">
          <filter type="and">
            <condition attribute="modifiedon" operator="last-x-hours" value="24" />
          </filter>
        </link-entity>
      </entity>
    </fetch>