none
IsAllDayEvent property is not set in exchange outlook calendar when i create the exchange appointment item using exchange service RRS feed

  • Question

  • Hello All,

          My requirement is create a new appointment in Exchange service using radscheduler. I am assigning the value for IsAllDayEvent property of Appointment, this appointment is created but this property is not set in corresponding exchange account. if i get the created appointment item and check this property, this property is true. only exchange account is not set. could anyone help me to resolve this

    this is code to create the appointment

      Save the Appointment Code:

     Microsoft.Exchange.WebServices.Data.ExchangeService service = new Microsoft.Exchange.WebServices.Data.ExchangeService(ExchangeVersion.Exchange2010_SP1);
                    service.Credentials = new NetworkCredential(exUserName, exPassword, exDomainName);
                    service.Url = new Uri(exUrlValue);
     Microsoft.Exchange.WebServices.Data.Appointment appntment = new Microsoft.Exchange.WebServices.Data.Appointment(service);
                        appntment.Subject = txtExSubject.Text.Trim();
                        appntment.Start = Convert.ToDateTime(radExFromDate.SelectedDate);
                        appntment.End = Convert.ToDateTime(radExToDate.SelectedDate);
                        appntment.Location = txtExLocation.Text.Trim();
                        appntment.IsAllDayEvent = true;//Here i am assigning true value

    appntment.Save(WellKnownFolderName.Calendar);  

    Get the Appointment Code:

    Microsoft.Exchange.WebServices.Data.ExchangeService service = new Microsoft.Exchange.WebServices.Data.ExchangeService(ExchangeVersion.Exchange2010_SP1);
                    service.Credentials = new NetworkCredential(exUserName, exPassword, exDomainName);
                    service.Url = new Uri(exUrlValue);

    Microsoft.Exchange.WebServices.Data.Appointment appt = Microsoft.Exchange.WebServices.Data.Appointment.Bind(service, new ItemId(savedValues[4]));

                                txtExSubject.Text = appt.Subject;
                                txtExLocation.Text = appt.Location;                           
                                chkAllDayEvent.Checked = appt.IsAllDayEvent;//here i am getting true value

    My problem is when i am opening the same item in exchange outlook calendar, in that item this all day event it not set as true.

    the same scenario Weekly Occurrence also not set in Exchange Outlook

    could you please some one help me to resolve this


    • Moved by Naomi N Friday, April 6, 2012 3:52 PM Possibility of the better answer (From:Forums Issues (not product support))
    • Edited by Santhanarasu Saturday, April 7, 2012 2:20 PM
    Friday, April 6, 2012 1:57 PM

Answers

  • When your creating an all day event the Start and End time should be 12:00 in the TimeZone of the Mailbox eg

                apt.Start = DateTime.Now.Date;
                apt.StartTimeZone = TimeZoneInfo.Local;
                apt.End = DateTime.Now.Date.AddDays(+1);
                apt.EndTimeZone = TimeZoneInfo.Local;

    If you set the time to something else or view the same mailbox from a machine with a different timezone from which is was set it wont display as an alldayevent in Outlook or may span multiple days in OWA.

    Cheers
    Glen

    • Marked as answer by Santhanarasu Monday, April 16, 2012 1:18 PM
    Tuesday, April 10, 2012 5:36 AM

All replies

  • When your creating an all day event the Start and End time should be 12:00 in the TimeZone of the Mailbox eg

                apt.Start = DateTime.Now.Date;
                apt.StartTimeZone = TimeZoneInfo.Local;
                apt.End = DateTime.Now.Date.AddDays(+1);
                apt.EndTimeZone = TimeZoneInfo.Local;

    If you set the time to something else or view the same mailbox from a machine with a different timezone from which is was set it wont display as an alldayevent in Outlook or may span multiple days in OWA.

    Cheers
    Glen

    • Marked as answer by Santhanarasu Monday, April 16, 2012 1:18 PM
    Tuesday, April 10, 2012 5:36 AM
  • Hello Glen,

          I tried this. it's not working, if i check it in the exchange, it's not check the all day event checkbox, but the alldayevent property is checked when i check using code, do you have any idea about this, kindly tell me please


    Thursday, April 12, 2012 12:45 PM
  • Outlook doesn't use this property to determine that an Appointment is an AllDay event for Outlook the Start and End Time is critical. I would suggest you use a Mapi Editor like OutlookSpy or MFCMapi  to look at the raw properties and have a look at the Start and End Time of all Day event that you create in Outlook and then compare that with one you create with your code. I'm pretty sure this will highlight the issue for you.

    Cheers
    Glen

    Friday, April 13, 2012 6:10 AM
  • Hello Glen,

           Thanks for you reply. now it's working the AllDayEvent functionality. and i have one more problem in this, could you please help to resolve this also. i am creating appointment with start date - 4/4/2012 and end date - 4/5/2012 and checked the all day event. in exchange outlook it's showing problem start and end date, after bind it into radscheduler it's showing one day extra like start date - 4/4/2012 and end date - 4/6/2012. do you have any idea on this please tell me, i am waiting for your reply.

    Note: if i am not check the alldayevent checkbox it's showing proper in both exchange outlook and radscheduler.

    Thanks,

    Santhanarasu


    Friday, April 13, 2012 11:01 AM
  • It sounds like the problem is with "radscheduler" (which im guessing is a third party component) can't handle the way Exchange needs to have its date time formatted for All Day events. I would say you'll need to write some sore of logic shim to converts the Allday events time into a format this is compatible with "radscheduler".

    Cheers
    Glen

    Monday, April 16, 2012 7:18 AM
  • ok thanks Glen
    Monday, April 16, 2012 1:18 PM