Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Measure user spent time on a case record

Posted on by Microsoft Employee

Hi All,

I've got on the Case entity form a subgrid named "AssigneesSubgrid" (from a custom entity called "gem_caseassignee") and within it two fields:

1. "gem_assigneename" - which is a lookup to the user entity.

2. "gem_worktime" - which is a single line text.

My requirement is to record the time spent on a case by the analyst the case was assigned to.

I might be wrong here but my logic tells me to check onLoad if current user equals the assigned user(a form field named "primary_analyst" which is also a lookup to the user entity) for the case. If indeed so, start a timer and create a record that will push it to the subgrid above onSave.

So for example: the analyst goes into a case record for 2.35 minutes at first.

Then he does it again for 4.15 minutes and so on and on possibly. you get the gist.

Ideally the subgrid I mentioned above would show that - first time /second time / third .. etc..

I'm not sure if it's even possible and where to begin.

I'd rather avoid plugin development  since it's not my forte.

Please share your insights on this matter.

Thank you,

- Bod

*This post is locked for comments

  • Suggested answer
    Goutham A Profile Picture
    Goutham A on at
    RE: Measure user spent time on a case record

    Yes , onsave can be . But for save button to be enabled, something needs to be updated on the form. Or else you should always forcefully make the form dirty as soon as you open it.(any user should compulsory save the form if he opens it)

    You can use webapi to create a new record in subgrid.(sample code present in below links)

    http://himbap.com/blog/?p=2035

    http://mydynamicscrmblog.blogspot.in/2016/03/crm-2016-web-api-create-record-with.html

    Thanks

    Goutham

    <<please mark my ans as verified if it solves your query>>

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Measure user spent time on a case record

    Can't the trigger be the Save button on the form?

    onLoad:

    • Check if current user = primary_analyst (user lookup)
    • Start timer

    onSave:

    • Capture time 
    • create record in subgrid

  • Suggested answer
    Goutham A Profile Picture
    Goutham A on at
    RE: Measure user spent time on a case record

    Hi Bodipa,

    If that is the case, you need some trigger when the user goes for break...like click on sommon ribbon button/dashboard that he will be on break. On taht button click you can write JS using Wen API(as you want it client side) to halt the time/ stop the record in AssigneesSubgrid. Again new record(in AssigneesSubgrid) can be created when the user comes back from break and clicks on begin work.

    Web Api : msdn.microsoft.com/.../mt607664.aspx

    Also, the user/assigne has only on workable  case at a point of time. You can have custom status for case form like created,waiting allocation, allocated/assigned, paused/break etc as per your requirement

    PLease see if below link helps

    community.dynamics.com/.../214924

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Measure user spent time on a case record

    How is that going to measure the time the assigned user spends on a given case?

    SLA is going to measure how long a case record is "Active".

    I'm interested in recording the actual time an analyst spends on a case.

    He can potentially go in several times for different duration lengths (as shown in my example) and that can span over days if not weeks - but in reality the analyst only spent 6 or 7 minutes on the record.

  • Suggested answer
    Goutham A Profile Picture
    Goutham A on at
    RE: Measure user spent time on a case record

    If you are using CRM 2013 and above, you can use the SLA feature.

    Make the default status of case as say "created". Make the sla to be fired only when case is active and whenever a case is assigned to an user, make the case active. UR SLA KPI will show the time spent on case

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans