This is a migrated thread and some comments may be shown as answers.

Recurrence Error

21 Answers 211 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Tommy Kan
Top achievements
Rank 1
Tommy Kan asked on 02 Jan 2010, 02:12 AM
I'm trying to generate the RecurrenceRule by code.
However,  it failed when selecting "Monthly" and "The first day of every month"

The error can be reproduced in Telerik Demo Web Site:

1.  Add a new appointment.
2.  Click the "Option" button
3.  Check the "Recurrence" checkbox
4.  Select "Monthly"
5. Select "The first day of every 1 month(s)"
6.  Click "Save"
7.  There was an error generated.

In my project, I got the "Object reference not set to an instance of an object" error.

Thanks,
Wilson


21 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 06 Jan 2010, 01:42 PM
Hi Tommy,

Thank you for reporting this issue. We were able to reproduce it easily thanks to your detailed instructions. We'll be working on a fix in the following days. Once we're ready the fix will included in the next internal build.

As a token of our gratitude for your involvement, your Telerik points have been updated.

Kind regards,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
towpse
Top achievements
Rank 2
answered on 06 Jan 2010, 02:36 PM
Does this error have anything to do with the recurrence rule string not getting generated properly?
Can you shed some light as to what the problem actually is if possible?
I was having some issues recently regarding the monthly First/Second/Third etc Day of every # month(s) recurrence...

Also it seems that after generating the error that the first poster noted, there is always a consistent error when deleting items it seems.
0
T. Tsonev
Telerik team
answered on 06 Jan 2010, 02:52 PM
Hello,

Indeed the problem is with generating the recurrence rule. We're not aware of any issues with deleting appointments us of now. Perhaps you can create a new forum thread with more details on the issue?

Best wishes,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
towpse
Top achievements
Rank 2
answered on 06 Jan 2010, 02:56 PM
well it's difficult to tell if the the two issues are related.
i simply reproduced tommy's steps since it sounded so familiar to an issue i was having.
after i get the first error message i try to delete the appointment i created and any other existing appointment and that same error dialog keeps popping up.


regards
0
Mark Galbreath
Top achievements
Rank 2
answered on 06 Jan 2010, 08:45 PM
When I schedule a singular appointment and then click delete, no events are fired that I can capture so I don't know where to put the delete code (I do everything in code-behind).  Then, when I try to delete the same event, I get the dialog box asking if I want to delete the singular instance or all occurrences (no multiple occurrences are ever selected by me).  Either option I select I am confronted with an exception:
System.InvalidOperationException: Cannot locate the parent of appointment with ID = '141'
Ensure that the parent appointment with 
ID = '0' exists and is loaded. 
I am really getting annoyed at the lack of good documentation for these controls.  I do not create webforms with drag-n-drop; no real programmer does.  Where is the documentation for all the methods and properties?

Cheerless,
Mark
0
towpse
Top achievements
Rank 2
answered on 06 Jan 2010, 10:45 PM
hey mark.
take a look here and see if this thread helps at all.
http://www.telerik.com/community/forums/aspnet-ajax/scheduler/parent-recurrence-id-bug.aspx
0
Mark Galbreath
Top achievements
Rank 2
answered on 06 Jan 2010, 11:05 PM
Thanks, towps, but it really doesn't shed much light on the problem.  If I knew the relationship between the appointment.ID and the reccurrence_parent_id, I might be able to figure out what is going on, but, of course, there is no documentation on this point.  Is there supposed to be a separate db table for occurrences that are mapped by foreign key to the appointment.ID?  What is going on?

I read the online documentation/tutorial on RadScheduler and it is no help.  In fact, it is downright stupid in offering a tutorial using the session context as the datasource instead of a database.  And it doesn't cover any advanced stuff like resource types, resources, or even how to get the added description and annotation fields.  The PDF documentation I found was published in Nov. 2008, and it mostly assumes, like the online documentation, that programmers like the VS Designer drag-n-drop.  It sucks!

Perhaps Russians can read minds, but I can't.

Cheers!
Mark
0
towpse
Top achievements
Rank 2
answered on 07 Jan 2010, 06:16 PM
the recurrence parent ID of a child appointment should be set to the appointment ID of a parent that is returned to the schedulers appointments collection.
I was receiving that same error when deleting an exception due to a data type issue (though it exists, comparing string verses Guid the framework won't find my parent).
Telerik is converting the appointment ID's to Guids, just as I set them, but not the parent ID's...

My Get Appointments method simply converts my specific custom object into a telerik appointment object. Any property on my class that I can't map directly to the telerik appointment I set in the appointment attributes collection.

That being said my backend tables store a parent recurrence Id with each of my individual scheudles so I can set up the parent child relations in the telerik appointment objects before i bind them to the scheduler.
0
Mark Galbreath
Top achievements
Rank 2
answered on 11 Jan 2010, 01:09 PM
I noted that the Scheduler tutorial that places the appointment objects in a session variable uses GUIDs for the recurrence parent IDs, and I tried that but was getting exceptions using GUIDs with String methods.  So I just let the database choose the ID by creating a sequence table.  Do you suppose this is the source of my problem?

Cheers!
Mark
0
Peter
Telerik team
answered on 11 Jan 2010, 01:18 PM
Hello,

There is a kb article on Using GUIDs as appointment primary keys with SQL Server. It has been updated to handle all cases (delete, update, insert) with recurring appointments as well.

Also, we have exposed additional server events to facilitate custom implementation of various scenarios related to recurring appointments -

  • OnOccurrenceDelete
  • OnRecurrenceExceptionCreated

 

Kind regards,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
towpse
Top achievements
Rank 2
answered on 09 Feb 2010, 06:08 PM
Has Tommy Kan's initial complaint been addressed?
I notice that I can successfully create monthly relative's on the demos but I'm still getting a parse exception on the recurrence rule in the latest release.

Has this been addressed in any recent internal builds?

regards,
0
Peter
Telerik team
answered on 12 Feb 2010, 01:52 PM
Hello towps,

Which version have you tested? Currently, the demo referenced in Tommy Kan's initial question no longer exhibits this problem. Let me know if I am missing something.


Greetings,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
towpse
Top achievements
Rank 2
answered on 12 Feb 2010, 02:41 PM
the demos seem fixed which is why i am posing my question.
i'm still getting the error in my project.
is this something that was fixed in the Web.UI.DLL or would it have been an advancedForm.js fix.

May I ask how the online demos needed to be corrected to fix the problem?
I really need a fix for the bug I am seeing.

Please take a look at the sample rule that was generated for one of my monthly realtive appointments. This is not parsable apparently.
Any help on how I can make certain that whatever generates the rule will always generate a valid one would be great!


DTSTART:20100216T090000Z
DTEND:20100216T093000Z
RRULE:FREQ=MONTHLY;UNTIL=89991231T235959Z;INTERVAL=1;BYSETPOS=NaN;BYDAY=



Regards,
0
Peter
Telerik team
answered on 16 Feb 2010, 12:35 PM
Hi towps,

This recurrence rule seem incomplete. Is this what RadScheduler generated? If not, then please send us the entire rule so we can test it.


All the best,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
towpse
Top achievements
Rank 2
answered on 16 Feb 2010, 01:02 PM
Yes this is taken directly from what the scheduler's been generating for monthly recurrence rules.
0
towpse
Top achievements
Rank 2
answered on 18 Feb 2010, 07:27 PM
The rule is broken in rrule after this call in the advanced form

 var rrule = $T.RecurrenceRule.fromPatternAndRange(this._getPattern(), range);
0
towpse
Top achievements
Rank 2
answered on 18 Feb 2010, 08:10 PM
Part of the error might have something to do with the fact that

parseInt(this._getElement("MonthlyDayMaskDropDown").value, 10);
&
parseInt(this._getElement("MonthlyDayOrdinalDropDown", 10).value);

returns NaN

In this case this._getElement("MonthlyDayMaskDropDown").value = "Tuesday" for example.
&
this._getElement("MonthlyDayOrdinalDropDown", 10).value = "second" // as in second tuesday of the month



i thought the problem might be in the _formatRRule function in teh RecurrenceRule.js file but that seems to depend on the parameters given which are the pattern and the range and in my case the pattern is messed up.

I'm going to look to see if a newer version of advanced form.js is up with the beta release and see if there are any changes in there that might help me.

regards
0
towpse
Top achievements
Rank 2
answered on 19 Feb 2010, 01:56 PM
I put my own fix in for this.
Updated the AdvancedForm.js file so that instead of trying to return the result of parseInt against the value of the selected combo box item, I just did a switch on the combo box item selected value string and returned the appropriate int value based on the telerik DayMaskValues enum and the DayOrdinalValues setup in the AdvacnedForm code behind.

Seems to do the trick. There may be a cleaner way of doing it using parseInt that I'm not aware of.
If there's a better fix, let me know.

I'm thinking the value of the items should be the integer.
The code behind seems to populate them with description and integer values.

Thanks.
0
T. Tsonev
Telerik team
answered on 19 Feb 2010, 03:17 PM
Hi,

Glad to see that you've managed to solve the problem. It should be fixed in the latest version of the AdvancedForm.js file as well.

The code now looks like this:
return parseInt(this._getControl("MonthlyDayMaskDropDown").get_value(), 10);

All the best,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
John
Top achievements
Rank 1
answered on 26 Feb 2016, 04:09 AM
We are also having a similar issue like RecurrenceRule parse Error ('System.NullReferenceException' in Telerik.Web.UI.dll )
We are  trying to generate the RecurrenceRule in c# code.
However,  it failed when selecting "Monthly" and "The first day of every month" or "The second day of every month" etc.

We have performed the following steps..

1. From the "Recurrence" section, selected "Monthly" option
2. Selected "The first day of every 1 month(s)"
3. Clicked on "Save" button and an error ('System.NullReferenceException' in Telerik.Web.UI.dll ) was generated at the RecurrenceRule.TryParse method. 

http://www.screencast.com/t/UaKU0nMeKnl

As per this post, we have upgraded our current telerik.web.ui.dll('2013.1.403.40') version to '2016.1.113.45'. Now we are  not getting null reference exception but, we could'nt  parse the rule corresponting to this appointment i.e. "DTSTART:20160225T171739Z\r\nDTEND:20160225T171739Z\r\nRRULE:FREQ=MONTHLY;INTERVAL=1\r\n". Could you please help?

0
Peter Filipov
Telerik team
answered on 01 Mar 2016, 11:47 AM
Hello John,

The format of the recurrence rule is not correct and it could not be parsed properly and the returned value is null. Here is a sample how this should be done. This could be easily inspected when in the XML file when an appointment is created e.g.:

var rule = RecurrenceRule.TryParse(@"DTSTART:20160218T000000Z
DTEND:20160219T000000Z
RRULE:FREQ=MONTHLY;INTERVAL=1;BYSETPOS=1;BYDAY=MO,TU,WE,TH,FR,SA,SU");


Regards,
Peter Filipov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Scheduler
Asked by
Tommy Kan
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
towpse
Top achievements
Rank 2
Mark Galbreath
Top achievements
Rank 2
Peter
Telerik team
John
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or