Calculate the number of working days, for which the demand was open.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 05:17 AM
Hello all,
I need to calculate the number of working days, for which the demand was open and populate a custom integer field called "Days Open" with the value. I am using a "8:30 to 5 Schedule" and running a schedule job for this.
Please let me know if anyone has worked on this before.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 05:36 AM
The best way to do this, is to utilize the SLA functionality for this. It's not an official Service Level Agreement, of course, but still, creating this functionality, including the schedule from scratch, while it is already there, would be a waste of time.
Create an SLA definition on the demand table. Start at 'opened', Stop at 'closed' on your schedule (you can even include Holiday schedules in there as well, so they aren't counted). If you really need this on the demand record, you can create a business rule or flow to update the new field, but if it's just for reporting, you can report on the task_sla table, where task.type = demand.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 05:42 AM
Thanks for the reply Mark.
Sorry, I should have clarified that I need the value on the "Days Open" field to be updated everyday, till its closure.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 05:44 AM
Sorry, I should have clarified that I need the value on the "Days Open" field to be updated everyday, till its closure.