Problem of finding end time of business day (current day)
I have the problem of finding end time of business day (current day). For example if an operator tries to perform an action on a case on Monday at 2 PM IST and as per his calendar business end time on Monday is 5 PM IST. then I should be able to get 5 PM in response.
Is there any OOTB for this ? Getting calendar instance though will solve the problem, but to get calendar instance we need startDate as its one of the key for Calendar instances. As calendar start date will not be associated to operator, how to overcome this challenge ?
Thanks in advance.
***Updated by moderator: Lochan to create new post from this reply***
Here the challenge is not adding business days or time to given time. Here the scenario is to find business end time for a given day.
For example: Operator A has a Calendar C associated to operator record. Calendar C has Monday as business day and with start time as 9 AM and end time as 5 PM (consider time zone as IST for now). When operator tries to access a case on Monday at 2 PM, using OOTB function I should be able to get 5 PM in response as on Monday end time for that operator is 5 PM.
As a work around we can get end time by explicitly opening calendar instance using calendar name associated to operator, but the challenge here is calendar instances have StartDate also has key and the same is not associated to operator.
Hope I have clarified the scenario and challenge I am talking about. Any help on this is much appreciated. Thanks in advance.
Create a report definition of applies to Data-Admin-Calendar with the configuration mentioned.
In the Filter column Source substring of pxInsName is made to only have datevalue.
The parameter CalendarName can be provided from operator details(pyCalendar).
and param CurrentDate be substring of currentdatetime with only date value to match the type of column source (this can be done from data transform or activity where ever the report is called)
As Sort type is of highest to lowest , first result would be the one for opening calendar instance . It contains pxInsName , we can open calendar instance with this key or with substring we can get startDate value.
Thanks for your inputs. This would help but more likely I am looking for any OOTB function which can help me get the business end time of the current day. Using the approach you have mentioned I might get the calendar instance but again I need to find the day (Monday/Tuesday) current day is and get the end time from the calendar instance using pyMondayEnd property if the day is Monday (Similarly for other days).