none
Bug while deleting birthday/wedding anniversary fields in contact (using ews api) RRS feed

  • Question

  • Hi all,

    I was recommended to ask this question in the development forum.

    we are using the EWS-Api and have a problem when deleting the fields Birthday and WeddingAnniversary in contacts.
    If we set the birthday date using the EWS-Api the birthday can be deleted.
    When setting the birthday in outlook and we use EWS to delete the birthday nothing happens, the birthday isn't deleted in the contact.
    Setting the birthday in outlook this automatically creates a recuring appointment "Birthday of ...". This isn't created when setting the birthday using EWS.
    The exact same happens when using the WeddingAnniversary.
    To get an idea where the problem is located we tested the following:
    We created a contact and set the birthday using EWS, the WeddingAnniversary was entered in outlook.
    Than we deleted both fields. The birthday was deleted, the WeddingAnniversary was not.

    Here is the xml snippet which was sent to the exchange server:
        <t:DeleteItemField>
            <t:FieldURI FieldURI="contacts:WeddingAnniversary"/>
        </t:DeleteItemField>
        <t:DeleteItemField>
            <t:FieldURI FieldURI="contacts:Birthday"/>
        </t:DeleteItemField>

    Response from exchange server:
        <m:ResponseMessages>
            <m:UpdateItemResponseMessage ResponseClass="Success">
                <m:ResponseCode>NoError</m:ResponseCode>
                ...
                <m:ConflictResults>
                    <t:Count>0</t:Count>
                </m:ConflictResults>
            </m:UpdateItemResponseMessage>
        </m:ResponseMessages>

    As you can see both fields should be deleted, but only the birthday is.
    Seems that the problem is located on the exchange server.
    Any ideas or suggestions?

    Many thanks,

    Markus

    Monday, September 28, 2015 6:50 AM

Answers

  • This isn't a bug there are 6 properties that provide these feature you talking about which are listed in https://msdn.microsoft.com/en-us/library/ee160476(v=exchg.80).aspx .

    >>Setting the birthday in outlook this automatically creates a recuring appointment

    This is a feature of Outlook so the Outlook client is creating an Appointment and then setting the above properties etc to provide this feature. You can do the same thing with EWS but you will need to implement your own client logic to do this and then use EWS as the API for doing the actions via the standard operations eg create an appointment, get the ItemId, convert it to hex and update the properties appropriately.

    To answer your question to delete all of those 6 properties using SOAP the following should work

      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2013_SP1" />
        </soap:Header>
        <soap:Body>
          <m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
            <m:ItemChanges>
              <t:ItemChange>
                <t:ItemId Id="AAMkADczNDE4YWEwLTdlZmItNDIzZC04MDViLTYyYjI2=" ChangeKey="EQAAABYAAAB1EEf9GOowTZ1AsUKLrCDQAACfjP+y" />
                <t:Updates>
                  <t:DeleteItemField>
                    <t:FieldURI FieldURI="contacts:Birthday" />
                  </t:DeleteItemField>
                  <t:DeleteItemField>
                    <t:FieldURI FieldURI="contacts:BirthdayLocal" />
                  </t:DeleteItemField>
                  <t:DeleteItemField>
                    <t:FieldURI FieldURI="contacts:WeddingAnniversary" />
                  </t:DeleteItemField>
                  <t:DeleteItemField>
                    <t:FieldURI FieldURI="contacts:WeddingAnniversaryLocal" />
                  </t:DeleteItemField>
                  <t:DeleteItemField>
                    <t:ExtendedFieldURI DistinguishedPropertySetId="Address" PropertyId="32846" PropertyType="Binary" />
                  </t:DeleteItemField>
                  <t:DeleteItemField>
                    <t:ExtendedFieldURI DistinguishedPropertySetId="Address" PropertyId="32845" PropertyType="Binary" />
                  </t:DeleteItemField>
                </t:Updates>
              </t:ItemChange>
            </m:ItemChanges>
          </m:UpdateItem>
        </soap:Body>
      </soap:Envelope>
    Cheers
    Glen
    • Marked as answer by Markus Rohrbach Wednesday, September 30, 2015 7:08 AM
    Tuesday, September 29, 2015 5:03 AM

All replies

  • This isn't a bug there are 6 properties that provide these feature you talking about which are listed in https://msdn.microsoft.com/en-us/library/ee160476(v=exchg.80).aspx .

    >>Setting the birthday in outlook this automatically creates a recuring appointment

    This is a feature of Outlook so the Outlook client is creating an Appointment and then setting the above properties etc to provide this feature. You can do the same thing with EWS but you will need to implement your own client logic to do this and then use EWS as the API for doing the actions via the standard operations eg create an appointment, get the ItemId, convert it to hex and update the properties appropriately.

    To answer your question to delete all of those 6 properties using SOAP the following should work

      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2013_SP1" />
        </soap:Header>
        <soap:Body>
          <m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
            <m:ItemChanges>
              <t:ItemChange>
                <t:ItemId Id="AAMkADczNDE4YWEwLTdlZmItNDIzZC04MDViLTYyYjI2=" ChangeKey="EQAAABYAAAB1EEf9GOowTZ1AsUKLrCDQAACfjP+y" />
                <t:Updates>
                  <t:DeleteItemField>
                    <t:FieldURI FieldURI="contacts:Birthday" />
                  </t:DeleteItemField>
                  <t:DeleteItemField>
                    <t:FieldURI FieldURI="contacts:BirthdayLocal" />
                  </t:DeleteItemField>
                  <t:DeleteItemField>
                    <t:FieldURI FieldURI="contacts:WeddingAnniversary" />
                  </t:DeleteItemField>
                  <t:DeleteItemField>
                    <t:FieldURI FieldURI="contacts:WeddingAnniversaryLocal" />
                  </t:DeleteItemField>
                  <t:DeleteItemField>
                    <t:ExtendedFieldURI DistinguishedPropertySetId="Address" PropertyId="32846" PropertyType="Binary" />
                  </t:DeleteItemField>
                  <t:DeleteItemField>
                    <t:ExtendedFieldURI DistinguishedPropertySetId="Address" PropertyId="32845" PropertyType="Binary" />
                  </t:DeleteItemField>
                </t:Updates>
              </t:ItemChange>
            </m:ItemChanges>
          </m:UpdateItem>
        </soap:Body>
      </soap:Envelope>
    Cheers
    Glen
    • Marked as answer by Markus Rohrbach Wednesday, September 30, 2015 7:08 AM
    Tuesday, September 29, 2015 5:03 AM
  • Thank you very much Glen.

    This was our solution

    Wednesday, September 30, 2015 7:09 AM