Dashboard with timeusage on tasks per company

lock
push_pin
done
Answered
0

Hi

We've created different task types (Example: Service, Configuration, Installation) and use those for work being done on different tasks.

I would like to be able to create some dashboards where I can see the total time/duration used on these tasks based  on company name within a certain period.

Does anyone have any experience on this? Is it even possible to get the duration on a task in the dashboard, I've not been able to find this.

 

Best regards

Ole

2 Nov 2022 | 05:06 PM

All Replies (0)

Hi,

Sadly there is no calculated duration field available in the appointment/activity archive providers. What we did to solve this since we had the same challenge as you described is to create a user defined field on the appointment entity. We automatically fill this field with the CRMScript before save appointment trigger:

EventData eventData = getEventData();

DateTime startDate = decodeDBValue(eventData.getInputValue("AppointmentEntity.StartDate")).toDateTime();
DateTime endDate = decodeDBValue(eventData.getInputValue("AppointmentEntity.EndDate")).toDateTime();


Integer diffSeconds = endDate.diff(startDate);
Float diffMinute = Float(diffSeconds) / 60.0;
Float diffHours = Float(diffMinute) / 60.0;

eventData.setOutputValue("AppointmentEntity.UserDefinedFields.SuperOffice:49", "[F:" + diffHours.toString(2) + "]");

Do note that this means that the duration is not updated when you change the something through the API. And you will also need to backfill the data for all existing appointments.

 

3 Nov 2022 | 08:06 AM

Note that a 'duration' field has been added to the relavant archives (10.2.1 version for OnSite). Thank you anonymous person from R&D for reading along ;)

 

3 Feb 2023 | 08:54 AM

Add reply