Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

Appointment . setIsAllDayEvent seems not to work correctly #328

@svettermann

Description

@svettermann

Hi there.

Creating Appointments, Tasks, Contacts, CheckDelegates working fine,
but not using setIsAllDayEvent(true) of the appointment.

Using:

  • ExchangeVersion.Exchange2010_SP2
  • api from today 10:00

Problem:
Setting start as first day and end at same day of the appoiment.
This shows 2:00 first day to 2:00 next day (watching this on outlook).
Also Outlook not set the checkbox for allDay so it seems not to be setup correctly.

Any workaround?

My code:

try (ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);) {
    service.setUrl(new URI(url));
    service.setCredentials(new WebCredentials(username, password));

    Appointment appointment = new Appointment(service);
    appointment.setSubject(subject);
    appointment.setBody(MessageBody.getMessageBodyFromText(content));

    appointment.setStart(startDate);
    appointment.setEnd(endDate);

    appointment.setIsAllDayEvent(isAllDay);

    appointment.setLocation(location);


    for(String recipient : recipients) {
            appointment.getRequiredAttendees().add(recipient);
     }

     appointment.save(new FolderId(WellKnownFolderName.Calendar, new Mailbox(sender)), SendInvitationsMode.SendToAllAndSaveCopy);

      return MSG_OK;
  } catch (Exception|Error ex) {
      return ex.getMessage();
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions