Hi,
Can anyone provide me a working exaple of custom data provider that provides features like varience and deleted instance of recurring activities.
Thanks,
Farrukh
I'm using a custom provider that i wrote, when I go through FetchActivities with the Root, and Variance having the same RecurenceKey, this is the error I get: "System.Exception: Recurrences must have only one recurring root appointment. This recurrence object already has a root appointment set, therefore attaching it to another root appointment is not permitted." My provider calls FetchActivities, loads all the activities, FetchRecurrences, loads the recurrences, Fetch Variances and loads the variances: Based on the context.Operation on the Fetch(DataContext context) method. I have been calling CreateVariance from the Base activity, because the Variance activity didnt have a RecurrKey and would throw an error if i tried to call create variance from a record with no RecurrKey.
So it sounds like I need to figure out why I can't have 2 activites with the same recurrenceKey, and that should solve my problem?
My first question would be around what error you're getting if the 2 activity records have the same recurrence key. My solution has the base activity with the same recurrence key as the variances. I think this is required too, because the VARIANCE_SEL procedure requires a recurrence key. It needs to know which series to get variances for.
After that, I would want to make sure you're calling CreateVariance off the base activity when you're populating the variance info.
I'm able to fire Fetch( FetchVarianceContext context ), I have an 2 activity records, both have the same variance key, 1 has recurrence, 1 doesn't because i recieved an error if they both had the same recurrence key, and the object has Variance is true. But the variance doesn't show up on the calendar, the orginal recurence still does. Any Help?
I think I found the reason why FetchVariances was never called. It would be nice if someone from Infragistics could confirm/explain this.
Derek mentioned above that we need to ensure the appointment doesn't have an empty variance key. There wasn't a property on the Appointment/Activity class to set a variance key, or so I thought. I dug through the Infragistics code to see what actually calls FetchVariances, and it is looking for a VarianceKey != Guid.Empty.
The problem is that the Activity class has a public property that isn't displayed in Intellisense. So I had no idea I could even set this property. The problem code is below (I think). After setting the (hidden) variance key the method is fired properly. Thoughts? Is it likely that there are other public properties hidden like this one?
[EditorBrowsable( EditorBrowsableState.Never)] [Browsable( false)] public Guid VarianceKey
{
...
I have a very similar problem, and have confirmed certain aspects of what was recommended above. I have done the following:1) On FetchActivities I can confirm that the RecurrenceKey is populated.
2) FetchRecurrences is called, which is great. I grabbed the recurrence list, created the recurrences and added them to the FetchRecurrenceContext's Recurrences collection. I also verified that I'm populating a recurrence with the same key as one of the appointments in step 1. All is well.
3) This is where I'd expect the FetchVariances operation to be triggered. Is that correct? If so, I never see it.
4) The next step that fires for me is FetchReminders. At this point I can see the WebScheduleInfo's Activities collection. I went back to the appointment verified in #1. It has a recurrence object populated, which to me tells me the two are linked.
Can you think of anything else I can do to track this down? Derek - for #2 on your suggestion, wouldn't a blank variance key only pertain once you're able to call FetchVariances? When fetching activities there is no VarianceKey to set - right? I may be missing something there...