Hi All,
Here is my scenario, We are using Sybase as our Backend Database and Powebuilder as our front-end. I have the Recurrence Event for the following pattern.
Daily Event (Week Day Only) from 5/1/2008 - 5/30/2008 from 8.00 AM - 9.00 AM
3 Exceptions for the above recurrence. For the Dates (13th, 21st and 29th) events are deleted. I captured all the 3 deletion as exception. Following is the script I used to populate the recurrence event with that 3 exceptions.
lole_master_event = lole_DataProvider.Createevent() ........ All Data processing for lole_master_event
lole_calendar_recurrence = lole_master_event.CreateRecurrence() lole_calendar_recurrence_options = lole_calendar_recurrence.Options
For ll_exception_index = 1 to exceptionscount
'Copy the Event as same as Master Event lole_exception_deletion = lole_master_event.CloneEvent()
'Remove the recurrence pattern from the exception event lole_exception_deletion.RemoveRecurrence()
'Set the StartTime and EndTIme to remove the event lole_exception_deletion.StartTime = idt_RExceptionStartTimeOrig lole_exception_deletion.EndTime = idt_RExceptionEndTimeOrig
lole_exception_deletion.RExceptionDeleted = true lole_exception_deletion.MakeAsRException() lole_calendar_recurrence.SetException(lole_exception_deletion)
lole_DataProvider.ChangeEvent(lole_exception_deletion) Next
lole_DataProvider.AddEvent(lole_calendar_event) lole_calendar_event.UpdateRecurrence(lole_calendar_recurrence)
For the above code, what it happens is recurrence master event created successfully and when it goes to the loop of exception, it removes the first exception from the calendar control (i.e May 13th) and the rest 2 exceptions stays there in the calendar control.
When I Debug, it is looping 3 times and it removes the exception for the very first iteration.
Please help me in finding out what am I doing wrong in setting the exception
Thanks
Karthik
|