Rollup Activity Plugin Solution for Dynamics 365 CRM

In this Blog I will be sharing my Rollup Activity Plugin solution to query the child activities values from the Parent record, allowing  users to easily identify the aggregate values and trigger workflows based on the Activity values directly from the parent record.  This helps overcome the current limitations of the native rollup fields allowing you to perform roll up Calculations in real-time and can be used to trigger Workflows. The Rollup Activity Plugin Solution currently provides the following rollup functions;

  • The Rollup  Count of the specified Open Child Activities
  • The Rollup of the latest Modified Date for a Specific Child Activity Entity
  • The Rollup of the Latest Modified Date for any Child Activity

The Rollup Activity Solution provides a Rollup Configuration Entity allowing you to create a new Rollup Configuration record for each rollup. For each rollup field create a New Rollup Configuration record via Settings > Rollup Configuration > New

  • Parent Entity: The Entity schema name to Identify the Entity you wish the activity rollup value to be available on
  • Operation: Define the rollup Operation you desire to perform;
    • A Count of Open Activities
    • The Last Modified date of any Activity
    • The Last Modified date for a specific Activity Entity
  • Child Entity Name: Provide the schema name of the Activity entity you are performing the rollup for such as task, phone call, or custom ie new_visit
  • Parent Field Name: Define the field that will be used for the rollup on the parent entity, for Count this should be a Whole number and for Dates this should be a date time field

 

Enabling and Disabling Rollups for specific Activity Entities

The Rollup Configuration is preconfigured for the for the following activity entities, however you can add your custom Activity Entity or disable them as required;

  • Task
  • Phonecall
  • Appointment
  • Service Activity
  • Custom Activities can also be added with steps provided below

How to Install the Rollup Activity Solution

 You can download the Activity Rollup  Solution for Dynamics CRM from the link below;

For performance reasons I have deactivated the  SDK Message Processing Steps for the following Activity Entities, however when installing the managed solution It will provide an option to automatically activate the steps for all the activity entities. Once you install the Rollup Activity Solution I recommend you can choose which activity entities you want to enable or disable for rollup in your create your custom solution by adding the steps into your custom solution and activating or deactivating the steps as shown below;

Add the Following SDK Message Processing steps into Solution Components via Solution > SDK Message Processing Step > Add Existing and select from the following list of MCRM.Plugin.RollupActivitiesCount Steps. There will be a Create, Update and Delete Step for Each Activity Entity;

Once the SDK message processing steps are added to your solution you can Activate or Deactivate the Steps for any Activities so that the plugin is only fired for the required activities, this is important to prevent unnecessary performance overhead .

Adding a new Step for a Custom Activity Entity

In order to enable the Activity Rollup for a Custom Activity entity you will need to register a Create, Update and Delete Step using the Plugin registration tool that you can run from the SDK/Tools/PluginRegistration;

Once you have successfully connected to the CRM deployment you can right click the MSCRM.Plugin.RollupActivitiesCount to Register the new  Create, Update & Delete Steps for the Custom Activity entity as  shown below;

To Register a Create Step, The Primary Entity should be your Custom Activity Entity;

 

 

 

Regiser an Update Step, The Primary Entity should be your Custom Activity Entity;

 

 

 

Register a Delete Step, The Primary Entity should be your Custom Activity Entity;

 

 

Now you can go back to your Custom Solution and Add the 3 New SDK Messaging Steps that you have created and the Rollup Configuration will support your Custom Activity Entity. I hope you find my Activity Rollup Plugin Useful and I look forward to improving it with more features for you. You can find the Activity Rollup Solution download link below;

 

Your Name (required)

Your Email (required)

Organisation Name / Website

Dynamics Version



mm
Author: Raz Dynamics
Razwan is a Microsoft MVP and Dynamics 365 Community Moderator responsible for developing Microsoft Dynamics 365 and CRM integrated solutions for over a decade. Razwan is responsible for delivering Dynamics 365 User Groups & CRM Saturday Conferences. Raz has developed many free community utilities for Dynamics 365 and CRM which you can download from this blog.