·
2 min read

Data management for Activity Feeds entities

We just released Activity Feeds for Microsoft Dynamics CRM. With most new features come the additional amount of data introduced with it and this is also true for Activity Feeds.

Every time a user creates a post or a comment, a record is created. Every time an auto post is generated, another record is created. With this in mind, prior to releasing this feature we made sure that you have an easy way to manage the data generated by Activity Feeds.

We enable the Activity Feeds entity, Posts, for Bulk Delete jobs. You can create your own bulk delete jobs from the user interface or from the SDK to clean up the Activity Feeds data based on your criteria.

Here is a quick snapshot on creating bulk delete job from the UI to clean up Posts entities.

    1.       Under Settings -> Data Management -> Bulk Record Deletion, create a new bulk delete job.

    2.       The bulk delete wizards will lead you to the look up dialog, where you should select the Posts entity type.

    3.       You can define your search criteria by Source, ModifiedOn, CreatedBy, CreatedOn. For example, to delete AutoPost that has not been commented for X months, you can specify Source = AutoPost and Modified On Older Than X

      4.       Just like any bulk delete job, you can specify the frequency of the run. Continue to the wizard and Submit.

      5.       All running and completed bulk delete jobs are displayed in these Bulk Record Deletion grid, but the master (recurrence) record itself is displayed under System -> System Jobs under the Recurring System Jobs View.

      Another way is to create bulk delete job from SDK. Here is a code snippet on triggering one bulk delete request from SDK to clean up Post entities.

      QueryExpression query = new QueryExpression(Post.EntityLogicalName);

      // create your filter criteria…

      BulkDeleteRequest request = new BulkDeleteRequest();

      request.QuerySet = new QueryExpression[] { query };

      request.JobName = “Activity Feeds Data Management”;

       

      request.SendEmailNotification = false;

      request.ToRecipients = new Guid[0];

      request.CCRecipients = new Guid[0];

      request.RecurrencePattern = string.Empty;

      request.StartDateTime = DateTime.Now;

      BulkDeleteResponse response = (BulkDeleteResponse)_serviceProxy.Execute(request);

       

      So there you go, 2 ways to manage your Activity Feeds data. I hope you find this helpful.  

      Maya Widyasari

      Microsoft Dynamics CRM Tester