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

Scheduler Recurrence Patterns and Exchange Recurrence Rules

18 Answers 955 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Timothy Kruszewski
Top achievements
Rank 1
Timothy Kruszewski asked on 23 Jun 2010, 02:49 AM
I have a 3rd party tool called MXSync which syncronizes data between Exchange Server and Sql Server.  We are using this in conjuntion with the scheduling tool and it's been working great with one exception.  Recurrence rules in exchange seem to be stored differently than recurrence pattenrs in the scheduling tool.  For example, I created a recurring appointing via outlook and it imported the data into SQL Server like this FREQ=DAILY;INTERVAL=1;COUNT=3;WKST=SU , the same recurring appointment created via the scheduling tool stores the data like this DTSTART:20100623T000000ZDTEND:20100624T000000ZRRULE:
FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU.  I don't know enough about exchange server to know if one format is correct or not.  If the formats to not match up properly data gets deleted from the scheduler when the data sync occurs and the recurring appointments get deleted.  Any help if getting this resolved would be appreciated,

Thank

18 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 25 Jun 2010, 04:49 PM
Hello Timothy,

The formats are very similar and both are based on the iCalendar standard. I guess that we can make it work if we get rid of the DTSTART and DTEND fields in the scheduler format.

We append them there to make the rule self-contained, but they're simply copies of the appointment start/end time (in UTC) and can be reconstructed on the fly.

My suggestion is to hook up to the AppointmentInsert/Update event and remove the DTASTART and DTEND fields from the RecurrenceRule. Then use the AppointmentDataBound event to reconstruct them from the appointment start/end.

Let me know if you need help with this.

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
Timothy Kruszewski
Top achievements
Rank 1
answered on 25 Jun 2010, 04:51 PM
A simple example of what you are describing would be greatly appreciated
0
Timothy Kruszewski
Top achievements
Rank 1
answered on 28 Jun 2010, 05:51 PM
I was able to figure out how to get the data parsed and stored properly in the database like this FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU but now I'm having trouble rebinding it to the scheduler.  This is how it should look to work properly

DTSTART:20100628T080000Z\r\nDTEND:20100628T120000Z\r\nRRULE:FREQ=DAILY;COUNT=4;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n

but my code is displaying like this and not spanning across the range of cells.

DTSTART:20100628T08:00:00Z\r\nDTEND:20100628T12:00:00Z\r\nRRULE:FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n


0
T. Tsonev
Telerik team
answered on 29 Jun 2010, 03:47 PM
Hi Timothy,

Apologies for the delay - we're pretty busy with the final preparations for the Q2 release and I couldn't get back to you earlier.

The problem seems to be in the formatting of the time - you shouldn't have colons between hours/minutes/seconds.

Please feel free to open a support ticket in order to send us the code that you're working on if you need help with anything specific.

Best wishes,
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
Timothy Kruszewski
Top achievements
Rank 1
answered on 29 Jun 2010, 07:55 PM
Here's what I'm doing to rebuild the string.  It's very ugly but it's building the string properly but it still does not display in the scheduler properly for recurring appointments.  If there is an easier way to do this please enlighten me.

Thanks

 protected void RadScheduler1_OnDataBound(object sender, EventArgs e)  
    {  
        if (RadScheduler1.SelectedView == SchedulerViewType.TimelineView)  
        {  
            foreach (Telerik.Web.UI.Appointment a in RadScheduler1.Appointments.GetAppointmentsInRange(RadScheduler1.VisibleRangeStart, RadScheduler1.VisibleRangeEnd))  
            {  
                if (a.RecurrenceRule != null)  
                {  
                    string startYear = a.Start.Year.ToString();  
                    string startMonth = a.Start.Month.ToString();  
                    string startDay = a.Start.Day.ToString() + "T";  
                    string startHours = a.Start.Hour.ToString();  
                    string startMinutes = a.Start.Minute.ToString();  
 
                    string endYear = a.End.Year.ToString();  
                    string endMonth = a.End.Month.ToString();  
                    string endDay = a.End.Day.ToString() + "T";  
                    string endHours = a.End.Hour.ToString();  
                    string endMinutes = a.End.Minute.ToString();  
 
                    switch (startMonth)  
                    {  
                        case "1":  
                            startMonth = "01";  
                            break;  
                        case "2":  
                            startMonth = "02";  
                            break;  
                        case "3":  
                            startMonth = "03";  
                            break;  
                        case "4":  
                            startMonth = "04";  
                            break;  
                        case "5":  
                            startMonth = "05";  
                            break;  
                        case "6":  
                            startMonth = "06";  
                            break;  
                        case "7":  
                            startMonth = "07";  
                            break;  
                        case "8":  
                            startMonth = "08";  
                            break;  
                        case "9":  
                            startMonth = "09";  
                            break;  
                        default:  
                            startMonth = a.Start.Month.ToString();  
                            break;  
                    }  
 
                    switch (startDay)  
                    {  
                        case "1":  
                            startDay = "01T";  
                            break;  
                        case "2":  
                            startDay = "02T";  
                            break;  
                        case "3":  
                            startDay = "03T";  
                            break;  
                        case "4":  
                            startDay = "04T";  
                            break;  
                        case "5":  
                            startDay = "05T";  
                            break;  
                        case "6":  
                            startDay = "06T";  
                            break;  
                        case "7":  
                            startDay = "07T";  
                            break;  
                        case "8":  
                            startDay = "08T";  
                            break;  
                        case "9":  
                            startDay = "09T";  
                            break;  
                        default:  
                            startDay = a.Start.Day.ToString() + "T";  
                            break;  
                    }  
                    switch (startHours)  
                    {   
                        case "1":  
                            startHours = "01";  
                            break;  
                        case "2":  
                            startHours = "02";  
                            break;  
                        case "3":  
                            startHours = "03";  
                            break;  
                        case "4":  
                            startHours = "04";  
                            break;  
                        case "5":  
                            startHours = "05";  
                            break;  
                        case "6":  
                            startHours = "06";  
                            break;  
                        case "7":  
                            startHours = "07";  
                            break;  
                        case "8":  
                            startHours = "08";  
                            break;  
                        case "9":  
                            startHours = "09";  
                            break;  
                        default:  
                            startHours = a.Start.Hour.ToString();  
                            break;  
                    }  
 
                    switch (startMinutes)  
                    {  
                        case "1":  
                            startMinutes = "0100Z";  
                            break;  
                        case "2":  
                            startMinutes = "0200Z";  
                            break;  
                        case "3":  
                            startMinutes = "0300Z";  
                            break;  
                        case "4":  
                            startMinutes = "0400Z";  
                            break;  
                        case "5":  
                            startMinutes = "0500Z";  
                            break;  
                        case "6":  
                            startMinutes = "0600Z";  
                            break;  
                        case "7":  
                            startMinutes = "0700Z";  
                            break;  
                        case "8":  
                            startMinutes = "0800Z";  
                            break;  
                        case "9":  
                            startMinutes = "0900Z";  
                            break;  
                        default:  
                            startMinutes = a.Start.Minute.ToString() + "000Z";  
                            break;  
                    }  
 
                    switch (endMonth)  
                    {  
                        case "1":  
                            endMonth = "01";  
                            break;  
                        case "2":  
                            endMonth = "02";  
                            break;  
                        case "3":  
                            endMonth = "03";  
                            break;  
                        case "4":  
                            endMonth = "04";  
                            break;  
                        case "5":  
                            endMonth = "05";  
                            break;  
                        case "6":  
                            endMonth = "06";  
                            break;  
                        case "7":  
                            endMonth = "07";  
                            break;  
                        case "8":  
                            endMonth = "08";  
                            break;  
                        case "9":  
                            endMonth = "09";  
                            break;  
                        default:  
                            endMonth = a.End.Month.ToString();  
                            break;  
                    }  
 
                    switch (endDay)  
                    {  
                        case "1":  
                            endDay = "01T";  
                            break;  
                        case "2":  
                            endDay = "02T";  
                            break;  
                        case "3":  
                            endDay = "03T";  
                            break;  
                        case "4":  
                            endDay = "04T";  
                            break;  
                        case "5":  
                            endDay = "05T";  
                            break;  
                        case "6":  
                            endDay = "06T";  
                            break;  
                        case "7":  
                            endDay = "07T";  
                            break;  
                        case "8":  
                            endDay = "08T";  
                            break;  
                        case "9":  
                            endDay = "09T";  
                            break;  
                        default:  
                            endDay = a.End.Day.ToString() + "T";  
                            break;  
                    }  
                    switch (endHours)  
                    {  
                        case "1":  
                            endHours = "01";  
                            break;  
                        case "2":  
                            endHours = "02";  
                            break;  
                        case "3":  
                            endHours = "03";  
                            break;  
                        case "4":  
                            endHours = "04";  
                            break;  
                        case "5":  
                            endHours = "05";  
                            break;  
                        case "6":  
                            endHours = "06";  
                            break;  
                        case "7":  
                            endHours = "07";  
                            break;  
                        case "8":  
                            endHours = "08";  
                            break;  
                        case "9":  
                            endHours = "09";  
                            break;  
                        default:  
                            endHours = a.End.Hour.ToString();  
                            break;  
                    }  
 
                    switch (endMinutes)  
                    {  
                        case "1":  
                            endMinutes = "0100Z";  
                            break;  
                        case "2":  
                            endMinutes = "0200Z";  
                            break;  
                        case "3":  
                            endMinutes = "0300Z";  
                            break;  
                        case "4":  
                            endMinutes = "0400Z";  
                            break;  
                        case "5":  
                            endMinutes = "0500Z";  
                            break;  
                        case "6":  
                            endMinutes = "0600Z";  
                            break;  
                        case "7":  
                            endMinutes = "0700Z";  
                            break;  
                        case "8":  
                            endMinutes = "0800Z";  
                            break;  
                        case "9":  
                            endMinutes = "0900Z";  
                            break;  
                        default:  
                            endMinutes = a.End.Minute.ToString() + "000Z";  
                            break;  
                    }  
                     
                    a.RecurrenceRule = "DTSTART:" + startYear + startMonth + startDay + startHours + startMinutes + "\r\nDTEND:" + endYear + endMonth + endDay + endHours + endMinutes + "\r\nRRULE:" + a.RecurrenceRule;  
                    //DTSTART:2010-06-28T08:00:00Z\r\nDTEND:2010-06-28T12:00:00Z\r\nRRULE:FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n  
                    //DTSTART:20100628T080000Z\r\nDTEND:20100628T120000Z\r\nRRULE:FREQ=DAILY;COUNT=4;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n  
                    //DTSTART:20100628T080000Z\r\nDTEND:20100628T120000Z\r\nRRULE:FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n  
                }  
            }  
        }  
 
    } 
0
Kevin Price
Top achievements
Rank 1
answered on 29 Jun 2010, 08:33 PM
Just to clean things up abit - not that it will help with the main issue, but
//Example of padding dates 
string startMonth = a.Start.Year.ToString(); 
if(startMonth.Length == 1) 
startYear += "0"; 
For each variable, it's a little cleaning than the case statement. Also - excuse the obvious if you're already doing this, but are you managing your dates in UTC throughout? We had similar issue with exporting to ics and Outlook interpreting correctly and that fixed it up.
ex. a.Start.ToUniversalTime();

Also, the RadScheduler has a DisplayToUtc method which has come in handy for collecting the dates in UTC without having to reformat them.

HTH,
Kevin


0
Timothy Kruszewski
Top achievements
Rank 1
answered on 30 Jun 2010, 12:20 AM
This is what the rebuilt string looks like, it looks identitcal to how the data in normally stored by the scheduler yet it still it not spanning the cell.  DTSTART:20100628T080000Z\r\nDTEND:20100628T120000Z\r\n
RRULE:FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n
    protected void RadScheduler1_OnDataBound(object sender, EventArgs e)  
    {  
        if (RadScheduler1.SelectedView == SchedulerViewType.TimelineView)  
        {  
            foreach (Telerik.Web.UI.Appointment a in RadScheduler1.Appointments.GetAppointmentsInRange(RadScheduler1.VisibleRangeStart, RadScheduler1.VisibleRangeEnd))  
            {  
                if (a.RecurrenceRule != null)  
                {  
                    string startYear = a.Start.Year.ToString();  
                    string startMonth = a.Start.Month.ToString();  
                    string startDay = a.Start.Day.ToString() + "T";  
                    string startHours = a.Start.Hour.ToString();  
                    string startMinutes = a.Start.Minute.ToString();  
 
                    string endYear = a.End.Year.ToString();  
                    string endMonth = a.End.Month.ToString();  
                    string endDay = a.End.Day.ToString() + "T";  
                    string endHours = a.End.Hour.ToString();  
                    string endMinutes = a.End.Minute.ToString();  
 
                    if (startMonth.Length == 1)  
                    {  
                        startMonth = "0" + startMonth;  
                    }  
 
                    if (startDay.Length == 1)  
                    {  
                        startDay = "0" + startDay;  
                    }  
 
                    if (startHours.Length == 1)  
                    {  
                        startHours = "0" + startHours;  
                    }  
 
                    if (startMinutes.Length == 1)  
                    {  
                        startMinutes = "0" + startMinutes + "00Z";  
                    }  
                    else { startMinutesstartMinutes = startMinutes + "00Z"; }  
 
                    if (endMonth.Length == 1)  
                    {  
                        endMonth = "0" + endMonth;  
                    }  
 
                    if (endDay.Length == 1)  
                    {  
                        endDay = "0" + endDay;  
                    }  
 
                    if (endHours.Length == 1)  
                    {  
                        endHours = "0" + endHours;  
                    }  
 
                    if (endMinutes.Length == 1)  
                    {  
                        endMinutes = "0" + endMinutes + "00Z";  
                    }  
                    else { endMinutesendMinutes = endMinutes + "00Z"; }  
                    a.RecurrenceRule = "DTSTART:" + startYear + startMonth + startDay + startHours + startMinutes + "\r\nDTEND:" + endYear + endMonth + endDay + endHours + endMinutes + "\r\nRRULE:" + a.RecurrenceRule;  
 
    } 
0
Timothy Kruszewski
Top achievements
Rank 1
answered on 30 Jun 2010, 10:40 PM
I've done some more testing and found the RecurrenceState Occurrence is not there for the records stored in the database like this FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU  which I'm assuming is why I only see the first day of the occuerrence on the scheduler.  Appointments stored like this DTSTART:20100628T080000Z  DTEND:20100628T120000Z  RRULE:FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU  loop through the Scheduler DataBound event several more times and display all of the scheduled events.  I need to know if there is something else missing from my code.  Is there some additional check I need to be doing for the RecurrenceState??

foreach (Telerik.Web.UI.Appointment a in RadScheduler1.Appointments.GetAppointmentsInRange(RadScheduler1.VisibleRangeStart, RadScheduler1.VisibleRangeEnd))  
            {  
                if (a.RecurrenceRule != null)  
                {  
                    if (a.RecurrenceState == RecurrenceState.Master || a.RecurrenceState == RecurrenceState.Occurrence)  
                    {  
                        string startYear = a.Start.Year.ToString();  
                        string startMonth = a.Start.Month.ToString();  
                        string startDay = a.Start.Day.ToString() + "T";  
                        string startHours = a.Start.Hour.ToString();  
                        string startMinutes = a.Start.Minute.ToString();  
 
                        string endYear = a.End.Year.ToString();  
                        string endMonth = a.End.Month.ToString();  
                        string endDay = a.End.Day.ToString() + "T";  
                        string endHours = a.End.Hour.ToString();  
                        string endMinutes = a.End.Minute.ToString();  
 
                        if (startMonth.Length == 1)  
                        {  
                            startMonth = "0" + startMonth;  
                        }  
 
                        if (startDay.Length == 1)  
                        {  
                            startDay = "0" + startDay;  
                        }  
 
                        if (startHours.Length == 1)  
                        {  
                            startHours = "0" + startHours;  
                        }  
 
                        if (startMinutes.Length == 1)  
                        {  
                            startMinutes = "0" + startMinutes + "00Z";  
                        }  
                        else { startMinutesstartMinutes = startMinutes + "00Z"; }  
 
                        if (endMonth.Length == 1)  
                        {  
                            endMonth = "0" + endMonth;  
                        }  
 
                        if (endDay.Length == 1)  
                        {  
                            endDay = "0" + endDay;  
                        }  
 
                        if (endHours.Length == 1)  
                        {  
                            endHours = "0" + endHours;  
                        }  
 
                        if (endMinutes.Length == 1)  
                        {  
                            endMinutes = "0" + endMinutes + "00Z";  
                        }  
                        else { endMinutesendMinutes = endMinutes + "00Z"; }  
                        string temp = "DTSTART:" + startYear + startMonth + startDay + startHours + startMinutes + "\r\nDTEND:" + endYear + endMonth + endDay + endHours + endMinutes + "\r\nRRULE:" + a.RecurrenceRule;  
                        //a.RecurrenceRule = temp;  
                        //a.RecurrenceRule = "DTSTART:" + startYear + startMonth + startDay + startHours + startMinutes + "\r\nDTEND:" + endYear + endMonth + endDay + endHours + endMinutes + "\r\nRRULE:" + a.RecurrenceRule;  
                        //DTSTART:2010-06-28T08:00:00Z\r\nDTEND:2010-06-28T12:00:00Z\r\nRRULE:FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n  
                        //DTSTART:20100628T080000Z\r\nDTEND:20100628T120000Z\r\nRRULE:FREQ=DAILY;COUNT=4;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n  
                        //DTSTART:20100628T080000Z\r\nDTEND:20100628T120000Z\r\nRRULE:FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n  
                    }  
                }  
            } 
0
T. Tsonev
Telerik team
answered on 02 Jul 2010, 02:45 PM
Hello Timothy,

The problem seems to be that our implementation for Daily recurrence rule currently requires BYDAY part to work. Adding it fixes the problem. See the other screenshot.

We'll fix the parse code to assume "every day" when BYDAY is missing, but for the moment you can add it manually:

if (rrule.Contains("DAILY") && !rrule.Contains("BYDAY"))
    rrule += ";BYDAY=MO,TU,WE,TH,FR,SA,SU";

You can use the following helper function for easier date formatting:

private static string FormatDateTime(DateTime date)
{
    return string.Format("{0:00}{1:00}{2:00}T{3:00}{4:00}{5:00}",
date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second);
}

I hope this helps.

Kind regards,
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
Timothy Kruszewski
Top achievements
Rank 1
answered on 04 Oct 2010, 06:46 PM
I'm having another issue with daily and weekly recurrences where a user will remove a particular day and it's still showing up on the calendar.  For example, I have a weekly recurring appointment set up for every Monday and want to exclude the week of October 25th.  When I delete that day only from the recurrence I get the pattern below but it's still displaying in my calendar.  Can you please let me know what's missing here in order to get the appointment for the 25th to Not display?

DTSTART:20090817T080000Z\r\nDTEND:20090817T235900Z\r\nRRULE:FREQ=WEEKLY;
INTERVAL=1;BYDAY=MO;EXDATE:20101025T080000Z;WKST=SU"

protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        try
        {
            var a = e.Appointment;
            Resource user = e.Appointment.Resources.GetResourceByType("User Name");
            Resource client = e.Appointment.Resources.GetResourceByType("Client Name");
            Resource category = e.Appointment.Resources.GetResourceByType("Category");
  
            string userName = user.Text;
            string clientName = "";
            if (client != null) { clientName = client.Text; };
            string categoryName = category.Text;
  
            a.ToolTip = "Subject:  " + a.Subject + "\n\nStart:  " + a.Start + "\n\nEnd:  " + a.End + "\n\nDescription:  " + a.Description + "\n\nUser:  " + userName.ToString() + "\n\nClient:  " + clientName.ToString();
  
            if (a.RecurrenceRule != null)
            {
                if (a.RecurrenceState == RecurrenceState.Master || a.RecurrenceState == RecurrenceState.Occurrence)
                {
                    string rrule = string.Empty;
                    if (a.RecurrenceRule.Contains("DAILY") || a.RecurrenceRule.Contains("WEEKLY") && !a.RecurrenceRule.Contains("BYDAY"))
                    { rrule = a.RecurrenceRule + ";BYDAY=MO,TU,WE,TH,FR,SA,SU"; }
                    else { rrule += a.RecurrenceRule; }
  
                    string temp = "DTSTART:" + FormatDateTime(a.Start) + "\r\nDTEND:" + FormatDateTime(a.End) + "\r\nRRULE:" + rrule;
                    a.RecurrenceRule = temp;
                }
            }
            if (user.Text != Session["UserName"].ToString())
            {
                a.AllowDelete = false;
                a.AllowEdit = false;
  
                if (SecurityHandler.CanWrite(SafeValue.SafeInt0(Session["UserID"].ToString()), "Scheduler Admin"))
                {
                    a.AllowDelete = true;
                    a.AllowEdit = true;
                }
            }
        }
        catch { }
    }

protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
    {
        // Starts and ends at midnight  
        bool allDay = e.ModifiedAppointment.Start.CompareTo(e.ModifiedAppointment.Start.Date) == 0 && e.ModifiedAppointment.End.CompareTo(e.ModifiedAppointment.End.Date) == 0; 
  
        string startDay = e.ModifiedAppointment.Start.ToShortDateString();
        string endDay = e.ModifiedAppointment.End.ToShortDateString();
  
        Resource user = e.ModifiedAppointment.Resources.GetResourceByType("User Name");
        //Resource pm = e.ModifiedAppointment.Resources.GetResourceByType("Email PM");
        Resource client = e.ModifiedAppointment.Resources.GetResourceByType("Client Name");
        Resource category = e.ModifiedAppointment.Resources.GetResourceByType("Category");
        string RecurrenceRule = e.ModifiedAppointment.RecurrenceRule;
        int ID = SafeValue.SafeInt(e.ModifiedAppointment.ID.ToString());
  
        using (ProNetData d = new ProNetData())
        {
            TED.BLL.Appointment a = d.Appointments.Where(i => i.ID == ID).FirstOrDefault();
            a.Subject = e.ModifiedAppointment.Subject;
            a.Description = e.ModifiedAppointment.Description != string.Empty ? e.ModifiedAppointment.Description : null;
            a.Start = e.ModifiedAppointment.Start.ToUniversalTime();
            a.End = e.ModifiedAppointment.End.ToUniversalTime();
            a.LastModificationTime = DateTime.Now;
            if (user != null)
            { a.UserID = SafeValue.SafeInt0(user.Key.ToString()); }
            if (client != null)
            { a.ClientID = SafeValue.SafeInt0(client.Key.ToString()); }
            if (category != null)
            { a.CategoryID = SafeValue.SafeInt0(category.Key.ToString()); }
            a.OutlookCreated = a.OutlookCreated;
            if (RecurrenceRule != "")
            {
                //int index = RecurrenceRule.LastIndexOf(":");
                int index = RecurrenceRule.LastIndexOf("FREQ") - 1;
                string s = RecurrenceRule.Substring(index + 1).Replace("\r\n", ";") + "WKST=SU";
                int len = s.Length;
                a.RecurrenceRule = s;
  
                if (RecurrenceRule.Contains("DAILY"))
                { a.RecurrenceType = 0; }
                else if (RecurrenceRule.Contains("WEEKLY"))
                { a.RecurrenceType = 1; }
                else if (RecurrenceRule.Contains("MONTHLY"))
                { a.RecurrenceType = 2; }
                else if (RecurrenceRule.Contains("YEARLY"))
                { a.RecurrenceType = 6; }
                a.IsRecurring = true;
            }
            else
            {
                a.IsRecurring = false;
                a.RecurrenceType = null;
            }
            //a.RecurrenceRule = e.ModifiedAppointment.RecurrenceRule;
            a.SyncToExchange = true;
            d.SaveChanges();
            {
                try
                {
                    int pmID = 0;
                    string desc = "";
                    string clientName = "";
                    if (a.Description != null) { desc = a.Description; }
                    if (client != null) { clientName = client.Text; }
                    //if (pm != null) { pmID = int.Parse(pm.Key.ToString()); }
  
                    SendMail(a.UserID, pmID, "<b>Subject:</b>  " + a.Subject + "<br><b>Start:</b>  " + a.Start + "<br><b>End:</b>  " + a.End + "<br><b>Description:</b>  " + desc + "<br><b>Client:</b>  " + clientName, (int)InsertUpdateDelete.Update);
                }
                catch { }
            }
  
        }
  
        // don't allow an appointment with a start date in the future to be
        // moved to the past
        //e.Cancel =
        //(e.Appointment.Start >= DateTime.Today) &&
        //(e.ModifiedAppointment.Start < DateTime.Today);
        //if (e.Cancel)
        //{
        //   //RadAjaxManager1.Alert("Cannot move an appointment to the past");
        //}
        BindSchedule();
    }
0
Timothy Kruszewski
Top achievements
Rank 1
answered on 11 Oct 2010, 04:09 PM
Can someone please respond to my October 4th post?  This EXDATE rule is causing me tons of problems.  I have to translate your rules into Exchange/Outlook rules in order for the appointment to be able to translate properly with my 3rd party syncing tool and I don't know of EXDATE is a standard Exchange rule.

FREQ=WEEKLY;COUNT=2;INTERVAL=1;BYDAY=TU,TH;  EXDATE:20100902T000000Z  ;WKST=SU
0
T. Tsonev
Telerik team
answered on 11 Oct 2010, 04:32 PM
Hello Timothy,

Apologies for late response.

I've tested a similar rule (attached) and it seems to work fine - the appointment is not showing in Outlook. I'm testing with Outlook 2010.

Can you please try importing the attached file and let me know if you see the exception in your calendar?

The EXDATE is standard part from the recurrence rule. See chapter 4.8.5.1 in the iCalendar standard for reference.

Kind regards,
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
Timothy Kruszewski
Top achievements
Rank 1
answered on 20 Oct 2010, 06:58 PM
I'm still having problems with the EXDATE parameter with regards to Exchange and Outlook.  As you can see from the examples below the rules seem to be identical except for the ordering of some of the parameters.  I need to be able to convert these outlook recurrence patterns to they will work with the RadSchedule. 

This is how Exchange is entering the rule into my appointments table (Not working)
FREQ=DAILY;INTERVAL=1;COUNT=3;EXDATE:20101021T120000Z;WKST=SU

This is how I convert the rule so it will display in on the RadSchedule (Not Working)
DTSTART:20101020T000000Z\r\nDTEND:20101021T000000Z\r\nRRULE:FREQ=DAILY;INTERVAL=1;COUNT=3;\r\nEXDATE:20101021T120000Z;WKST=SU;BYDAY=MO,TU,WE,TH,FR,SA,SU

This is how the RadSchedule is entering the rule into my appointments table (Working)
FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU;EXDATE:20101021T080000Z;WKST=SU

This is how I convert the rule so it will display in on the RadSchedule (Working)
DTSTART:20101020T080000Z\r\nDTEND:20101020T120000Z\r\nRRULE:FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU;\r\nEXDATE:20101021T080000Z;WKST=SU
DTSTART:20101020T080000Z\r\nDTEND:20101020T120000Z\r\nRRULE:FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU;\r\nEXDATE:20101021T080000Z;WKST=SU
0
T. Tsonev
Telerik team
answered on 26 Oct 2010, 11:59 AM
Hi Timothy,

Thank you for the additional details.

The EXDATE parameter is part of the RRULE component and must be on the same line. Please remove the highlighted new line.

...COUNT=3;\r\nEXDATE:...

We've fixed the DAILY recurrence rules requiring BYDAY=MO,TU,WE,TH,FR,SA,SU; and this fix will be included in the Q3 release.

I hope this helps.

Kind regards,
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
Timothy Kruszewski
Top achievements
Rank 1
answered on 26 Oct 2010, 03:09 PM
The RadScheduler is inserting a space(\r\n) in from of the EXDATE parameter.  Without the space the excluded day still shows up on the calendar.

"DTSTART:20101026T080000Z\r\nDTEND:20101026T120000Z\r\nRRULE:FREQ=DAILY;COUNT=3;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\nEXDATE:20101027T080000Z\r\n"
0
T. Tsonev
Telerik team
answered on 28 Oct 2010, 05:13 PM
Hi Timothy,

My mistake, the EXDATE is indeed rendered on a new line by RadScheduler. I'm sorry for overlooking this.

So the rule should be ordered like this:

DTSTART:20101020T000000Z
DTEND:20101021T000000Z
RRULE:FREQ=DAILY;INTERVAL=1;COUNT=3;WKST=SU;BYDAY=MO,TU,WE,TH,FR,SA,SU
EXDATE:20101021T120000Z;

This still won't work as the EXDATE doesn't match any occurrence. We must change it to:

DTSTART:20101020T000000Z
DTEND:20101021T000000Z
RRULE:FREQ=DAILY;INTERVAL=1;COUNT=3;WKST=SU;BYDAY=MO,TU,WE,TH,FR,SA,SU
EXDATE:20101021T000000Z;

By the way, we've fixed the DAILY recurrence rule parsing and it will no longer require BYDAY part starting from Q3.

I hope this helps.

Kind regards,
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
Timothy Kruszewski
Top achievements
Rank 1
answered on 04 Nov 2010, 12:08 AM
I'm having issues trying to translate the RadScheuler rules to rules that Exchange Server can understand.  The examples below show how exchange and the rad scheduler save a recurring appointment that happens on the last wednesday of every month, lasting for 3 months.  And I'm still having problems with the EXDATE in my prior post.  Has the Q3 update been posted yet that is supposed to resolve the EXDATE issue?

Outlook Recurrence Rule

FREQ

=MONTHLY;INTERVAL=1;BYDAY=5WE;UNTIL=20110330T070000Z;WKST=SU

Scheduler REcurrence Rule

 

FREQ

=MONTHLY;COUNT=3;INTERVAL=1;BYSETPOS=-1;BYDAY=WE;WKST=SU

 

0
T. Tsonev
Telerik team
answered on 09 Nov 2010, 04:10 PM
Hello Timothy,

I can confirm that RadScheduler doesn't support the BYDAY=5WE format, although Exhange should support the BYSETPOS format. We'll consider adding such supporting to the parser in the future.

The Q3 release will be available for download shortly - within a day or so.

I hope this helps.

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
Tags
Scheduler
Asked by
Timothy Kruszewski
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Timothy Kruszewski
Top achievements
Rank 1
Kevin Price
Top achievements
Rank 1
Share this question
or