Hi i am using Custom Datasource and adding a FetchRecurrence method.
Problem i am not able to assign Maxrecurrence in Recurrence activity.
2. One more Problem:
How to Set End date in case of Maxoccurence:Infragestic is Doing this i check the Database
Suppose i set 10 occurence then how to send End date with weekdays and without weekdays in Database.
Can someone from Infragestic Team Help me to find out about EndDateUTC Logic in Recurrence Table.How you are
Setting EndDate if user select Maxoccur.
Please See code
private void FetchRecurrences(FetchRecurrencesContext context) {
Recurrence recurrenceObject = null; recurrenceObject = new Recurrence(null); recurrenceObject.DayOfMonth = ReservationDTO.RecurrenceItemDetails.Dayofmonth; recurrenceObject.MaxOccurrences = 10;//Exception thrown }
Thanks
There is not enough information to calculate an end date based on the MaxOccurrences here, that is why you get the exception (if I had to guess, it's an NRE because either start or end date is not set?)
Here is the missing information:
In Fetch Recurrences, you should just set the properties from the Recurrence data model, meaning set the EndDateUtc. MaxOccurrences isn't in the data model because it is a derived field, dependent on other fields for its value. Don't worry about attaching it to an Activity yet, and don't expect all of its properties to be self-consistent (because the properties have not all been loaded, one property setting isn't going to be enough to calculate all of its properties) during Fetch.
You can make-up an EndDateUtc the first time (as long as it's in the future), and come back later (when it has been attached to its root activity, and all of its fields have been loaded from the data source) to set MaxOccurrences. When WebSchedule hands you back the Recurrence object to save later, it will give you the right EndDateUtc.