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
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>>
Can't the trigger be the Save button on the form?
onLoad:
onSave:
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
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.
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156