Hello -
I've been working with a custom implementation of the WebSchedule. I'm setting up recurrence and variances, and things seem to be working. I've run into one problem though. When I create a variance to the recurrence pattern, things fire as I'd expect. When I then go back to that variance and update it again, the only method that gets called is UpdateActivity. The challenging part is that the Appointment passed in has no variance flags set. It has no variance key, and IsVariance is set to false. It does get the correct data key, and the only way I've found to identify it as a variance is a strange combination of the IsStandAlone, RecurrenceKey and Recurrence properties.
Has anyone else run into this? Should the UpdateVariance method be called in this situation? I'd like to get rid of the hack which checks a combination of properties if possible...
Thanks!
brassier,
Were you ever able to find the solution to your problem? I'm now encountering the same issue.
Thanks - JP
I do have a solution that passed our testing, but it isn't pretty. When updating an activity, here's what I did to determine if the activity was a variance or not. I assumed it was a variance if:
(1) The appointment has a recurrence key set (meaning the recurrence wasn't deleted) - appt.RecurrenceKey(2) The appointment doesn't have a recurrence object (meaning this variance isn't tied to a recurrence directly (anymore) - appt.Recurrence(3) The appointment is stand-alone (not part of the recurrence anymore) - appt.IsStandAlone(OR)(4) The appointment has a variance key that doesn't equal Guid.Empty - appt.VarianceKey
So I saw 2 scenarios during my testing. One scenario had 1-3 true, and another had 4 true. This all happened right when I found the appt.VarianceKey property (which wasn't visible through intellisense). So there is a chance that #4 will always be true if you use the VarianceKey properly. The big issue I have is that this is kind of a hack. I feel that UpdateVariance should be triggered, but nobody responded to that initial question.
Hope it helps...