search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

DataRecurrenceField, single events in db and "The recurrence info id doesn't correspond to event id." error

Asked by mrplatypus
8 years ago.
In the posting:
http://forums.daypilot.org/Topic.aspx/3053/example-of-storing-recurring-events-as-separate-records-ple

You mention the following:

1. store the original event with the rule in a special DB field
2. generate the occurrences from the rule
3. store these occurrences as standalone records, add a special field that will identify the record as a "cached occurrence"
4. don't forget to merge these records with any exceptions from the rule (if they are defined)
5. you need to update the cached occurrences whenever the rule changes
6. you don't specify DataRecurrenceField in this case - the occurrences look like normal events to DayPilot
7. you might need a special DB field that will let you recognize the record as part of a recurring series 

In point 6 what would be the result of leaving the DataRecurrenceField n place for the control?

I am currently experiencing the following error:

The recurrence info id doesn't correspond to event id.

Are the two issues related?

If the two are related, it then seems the case of its an either or situation: either I have single records for each and every event or using the auto use for creating and maintaining events??

Answer posted by Dan Letecky [DayPilot]
8 years ago.

> In point 6 what would be the result of leaving the DataRecurrenceField n place for the control?

If you leave DataRecurrenceField property empty the control will not read the recurrence rule from there (and will not expand it).

> The recurrence info id doesn't correspond to event id.

Each rule is created for a specific record, e.g.:

Rule r = RecurrenceRule.FromDateTime("1", DateTime.Now);  // "1" is the master record id

The record id is encoded as part of the rule string. If this id doesn't match the record id you will see this error.

Comment posted by mrplatypus
8 years ago.

Dan,

>> In point 6 what would be the result of leaving the DataRecurrenceField n place for the control?

>If you leave DataRecurrenceField property empty the control will not read the recurrence rule from there (and will not expand it).

Sorry Dan for not being clear enough - if the DataRecurrenceField is left in place for the control, I guess that I would see recurring events plus the newly created events as well?

>> The recurrence info id doesn't correspond to event id.
>Each rule is created for a specific record... The record id is encoded as part of the rule string. If this id doesn't match the record id you will see this error.

So back to my requirement for going towards single events, the new events should have their rule field nullified?

Comment posted by Dan Letecky [DayPilot]
8 years ago.

You can use a mixed approach like this:

1. Events that you expanded manually should have "null" in the field specified using DataRecurrenceField. They will behave like regular events. The control will know nothing about where they came from. If you need to recognize them as recurring in your code you need to use custom tags (DataTagFields).

2. You can have events with the recurrence string in the field specified using DataRecurrenceField. These will be expanded automatically.

The "The recurrence info id doesn't correspond to event id." is not related to mixing these two types of recurring events. It means that you have used an incorrect master id when creating the rule. The generated rule always belongs to a single master record. If you copy it to another master record you will see this error.

Comment posted by mrplatypus
8 years ago.

Thanks for the advice...

Further to:
>>The "The recurrence info id doesn't correspond to event id."

I've tracked down the error, I did not realise that the rule also encodes/caters for the originating record that generated it, hence the reason for the error..

As regards using custom data tag fields, I've got a work around for that too..
Before the event is rendered, the beforeeventrendereventargs variable contains a dataitem of the datasource ... I'll use that rather than generating my own datatag fields..
What are your thoughts on this?

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.