Hi there,
We have built schedule software based on DayPilot. When DayPilot deployed the new version with 1-record based recurrence things began to go bad.
The main problem is that base events and their exceptions should ALWAYS be available in the set of events that you get from the database and pass on to the control to expand. The control needs these two records to correctly determine which event to show.
This might work well in simple calenders, but in our case we have several departments with their own employees. Some of these employees work on multiple departments. So this happens:
Department A has
Department B has
If I create a recurrent event for Employee I in department A it shows correctly for that Employee in department B. So far so good.
If I move an instance of that event from Employee I to Employee II (creating an exception-record in the process) and the scheduler refreshes then in Department A I see the the event in Employee's II schedule and not in Employee's I anymore. So far so good.
Now, when I show the schedule for department B where Employee II doesn't work, I only get the original base event from the database and feed that to the control. So what happens now, the control does not know anything about an exceptionrecord and shows the event in the schedule of Employee I! Offcourse this event should not show here as it has been moved to another department.
This also happens when I want to doubleclick on an employee and only wants to show the weeklyschedule for that employee. Any exceptions moved to other employees in that department won't load so the original event is shown in this weekly schedule, and we don't want that.
To make things worse, it also happens the other way around:
Department A has
Department B has
If I create a recurrent event for Employee II in department and move it as an exception to Employee I it shows correctly for that Employee in department A. So far so good.
But when I go to department B there is no base appointment in the resultset for that department because Employee II doesn't work there. So the control doesn't show the exception-event for Employee either!
This last problem can be 'solved' by looping through the resultset and identify all exception-records that have no matching base-record. For these records I remove the recurrenceinfo so the control won't try to match it to a base record. This way it will show in the calender as a 'regular' one time only event. It's not ideal though and makes it very prone to bugs because all of the different combinations.
If I would want to solve the first problem (base events showing up unwanted) I would have to search the database for matching exceptions in the database FOR EACH non-exception event in that schedule (which might be 100+ easily). This will drag down performance. Also it's very hard to find a matching exception for all of these 'virtual' events as these don't exist in the database.
Is there anything I can do to prevent these problems without having to go back to the old way?
TIA
Gabriel