locked
Summing case activity durations on open/active case entity RRS feed

  • Question

  • Does anyone know if there is a way to sum all associated activities against a case into a new read only attribute field on the case entity?

    i.e If i have a task completed task that is 45 minutes, another completed task that is 15 mins and a completed phone call that is for 1.5 hours is there a way that I can have a running total of total time spent (in this example = 2.5 hours) so far on an active case?

    If this is possible can this disclude any tasks that are active and not yet completed?

     

    Tuesday, July 20, 2010 3:59 AM

Answers

  • Hi I ended up creating a workflow to sum all activities (one per activity type) set regarding a case. I added custom boxes for these on the case form and set another workflow to increment the values by each completed activity of that type. I then created a total time spent text box increments by each of the activity totals. Seems to work thus far!!!
    • Marked as answer by M I K E 4 4 Thursday, September 2, 2010 2:04 AM
    Thursday, September 2, 2010 2:04 AM

All replies

  • The Best option is to write a plugin [or custom workflow assembly and add workflow steps] which will calculate the sum of total time spent on each activity and update the time on Case entity in custom attribute.

    Build your query in such a manner which tasks you want to include and which are not. You can easily do this using the Query Expressions.

    But you have to register the plugin on Create / Update / Delete operations on all the activities which you want to consider for your solution.

    Hope this will help


    Thanks, Ranjitsingh R | http://mscrm-developer.blogspot.com/ | MS CRM Consultant
    • Edited by Ranjitsingh R Tuesday, July 20, 2010 4:36 AM Added extra comments
    • Proposed as answer by Ranjitsingh R Wednesday, August 4, 2010 8:18 AM
    • Marked as answer by DavidJennawayMVP, Moderator Thursday, August 5, 2010 3:13 PM
    • Unmarked as answer by M I K E 4 4 Thursday, September 2, 2010 2:01 AM
    • Unmarked as answer by M I K E 4 4 Thursday, September 2, 2010 2:01 AM
    • Unproposed as answer by M I K E 4 4 Thursday, September 2, 2010 2:01 AM
    • Unproposed as answer by M I K E 4 4 Thursday, September 2, 2010 2:01 AM
    Tuesday, July 20, 2010 4:35 AM
  • if the field is read only, then i would advise using another field and gathering the information via javascript calls to the web service on the OnSave Event. Use that new field from now on? <= just an easier option if you dont want to programme in .net!

    Jonathan Nachman MBSP, MCTS

    Microsoft CRM Technical Blog

    Technical CRM Consultant for KMS Software
    Tuesday, July 20, 2010 1:13 PM
  • Hi I ended up creating a workflow to sum all activities (one per activity type) set regarding a case. I added custom boxes for these on the case form and set another workflow to increment the values by each completed activity of that type. I then created a total time spent text box increments by each of the activity totals. Seems to work thus far!!!
    • Marked as answer by M I K E 4 4 Thursday, September 2, 2010 2:04 AM
    Thursday, September 2, 2010 2:04 AM