We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Uniquely identify each occurrence of recurring event

Hi, I spent a lot of time browsing and experimenting with various examples posted on the docs and forums, but I am not able to think of a way to achieve what I want. When a recurring event is created on the scheduler, it is usually stored as one single record in the DB, with recurrenceRule string as a column. The problem with this approach is that, there is no way to uniquely identify one single occurrence in a series and add attributes specific to that occurrence. For e.g. what if I want to have "classroom" as location, for all occurrences of a series, EXCEPT the last one, which has "playground" as the location?  (I am referring to the location (second column) of the event editor window)

I also looked at recurrence exception, but that only contains excluded dates from a series, but doesn't store what information really differed from the series and the individual occurrence. For the above example, how can I represent the fact that, only the last occurence in the series has a different location? 

I observed that every occurrence on the scheduler has GUID, which is unique. Is there a way I can use this GUID to track individual occurences 
in a series, to identify them uniquely? For instance, after I create a series of 10 occurrences, all having the location initially, 
but I then edit location of the last occurrence? In this case, can I store this change in the DB, by using the last occurence's GUID
along with the changed location? Also, keep in mind I use REST APIs to interact with my backend; I am using promises to interact with backend

A code sample will be helpful.

thx



Attachment: Archive_11d35184.zip

5 Replies

VM Vengatesh Maniraj Syncfusion Team November 20, 2019 07:56 AM

Hi Jose, 
Syncfusion greetings. 
We can get the recurrence event collection for a single record by using getOccurrencesByID method. But we can not edit the particular event form this list. Because we have filter the recurrence events(while editing) by getting the events which is rendered in the current view. If the event is rendered in the current view which one we wish to edit, we can edit it easily by using saveEvent method. But if it is not in the current view, we can not edit. We have prepared the sample for getting all the recurrence collections for particular events which is available in below link. 
Kindly try the above sample and revert us for further assistance. 
 
Regards, 
Vengatesh 



JL jose lara November 20, 2019 04:00 PM

I am already aware of getOccurrencesByID and this is not helpful in my case. This is just a bad design in my opinion. When you update a field (location for example) of  a specific occurrence in a series, I see the "Recurrence exception" field getting updated with this particular event's date. But, how can you keep track of what information changed in that particular event? I am trying to save the information that changed (updated location) and save it in the DB. This will help me fetch the updated details from the DB when the user refreshes the page or navigates to that particular date. 




VD Vinitha Devi Murugan Syncfusion Team November 21, 2019 07:34 AM

Hi Jose, 
 
Thanks for your update. 
 
We have checked the reported scenario at our end. We can get the event fields which edited from the series by comparing the edited event with it series events. We have no other in-build functionality to get what field edited in particular series. We have prepared the sample based on your requirement which is available in below link. 
 
https://stackblitz.com/edit/angular-h76rah-rait53?file=app.component.ts                                                                                                                                               
 
In the above sample, we have excluded the Id, RecurrenceException, RecurrenceRule StartTime and EndTime fields from comparison. While comparing the event data, Id field is always varied. So no need to include this in comparison. Based on your requirement you can include StartTime and EndTime fields. 
 
 
Regards, 
M.Vinitha devi 



SR sai revanth September 22, 2021 12:39 PM

We are storing Recurence event as single document in Mongo, and using same input while

populating in synfusion scheduler.

When we delete one event from Series we are able to save "ReccurenceException" field in the same mongo

Document and able to populate in UI scheduler.

But when we update single event (StartTime or EndTime etc) from series or occurence. which additional field we can use(if there is any like "recurrenceException"

to store the series in single mongo document and populate it in scheduler)?

As we have 100's of events we want to store in DB as single document for series with updated occurence.

Please help

Regards,

Sai revanth.



VD Vinitha Devi Murugan Syncfusion Team September 23, 2021 08:34 AM

Hi Sai, 
 
Thanks for your update. 
 
We have validated your reported query “But when we update single event (StartTime or EndTime etc) from series or occurence. which additional field we can use(if there is any like "recurrenceException" to store the series in single mongo document and populate it in scheduler)?” at our end and let you know that following process takes place when you edit the single occurrence form the series. 
  • A new event will be created from the parent event data and added to the Scheduler dataSource, with all its default field values overwritten with the newly modified data and additionally, the RecurrenceID field will be added to it, that holds the Id value of the parent recurring event. Also, a new Id will be generated for this event in the dataSource.
  • The parent recurring event needs to be updated with appropriate RecurrenceException field to hold the edited occurrence appointment’s date collection.
 
Refer below image for server side parameter from scheduler, when we edit single occurrence from series. 
 
 
 
Mongo DB image for single occurrence edit 
 
 
 
Scheduler UI: