none
Set date to null in EWS RRS feed

  • Question

  • I have a task item that has start date and due date.

    How can I update the date to null using the UpdateItem operation.


    <t:DueDate>2016-03-02T18:18:00Z</t:DueDate>

    I tried 

    <t:DueDate>null</t:DueDate>

    <t:DueDate></t:DueDate>

    <t:DueDate/>

    But it doesn't work.

    I appreciate any help.

    Thursday, March 3, 2016 8:20 PM

All replies

  • You can't set a Date property to null the best thing to do is if you don't want the DueDate is to delete the extended property for the DueDate eg

        <soap:Body>
          <m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
            <m:ItemChanges>
              <t:ItemChange>
                <t:ItemId Id="AAMkAzNDAA=" ChangeKey="EwAA8" />
                <t:Updates>
                  <t:DeleteItemField>
                    <t:ExtendedFieldURI DistinguishedPropertySetId="Task" PropertyId="33029" PropertyType="SystemTime" />
                  </t:DeleteItemField>
                </t:Updates>
              </t:ItemChange>
            </m:ItemChanges>
          </m:UpdateItem>
        </soap:Body>
    Cheers
    Glen


    Friday, March 4, 2016 3:47 AM
  • Thank you for you help.

    I tried your method but unfortunately the due date field remain as it is.

    Another question: I searched the web for the list of property ids, but no luck. Please guide me.

    This is the code I tried to delete the due date and set the other fields for a task item.

    Thank you again.

    <?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soap:Header>
          <t:RequestServerVersion Version="V2016_01_06" />
       </soap:Header>
       <soap:Body>
          <m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
             <m:ItemChanges>
                <t:ItemChange>
                   <t:ItemId Id="AAMkAGEzZTIzOWNmLWFiMGUtNDg5NC05NzNlLTUxN2FmNGQ3ZjIxMQBGAAAAAADebl5aE9iCT5TWghrsI/MnBwDm30SftRRfT5FqZfPmjZoaAAAAAAESAADm30SftRRfT5FqZfPmjZoaAAFuMqNqAAA=" ChangeKey="EwAAABYAAADm30SftRRfT5FqZfPmjZoaAAF0FahD" />
                   <t:Updates>
                      <t:SetItemField>
                         <t:FieldURI FieldURI="item:Subject" />
                         <t:Item>
                            <t:Subject>Test</t:Subject>
                         </t:Item>
                      </t:SetItemField>
                      <t:SetItemField>
                         <t:FieldURI FieldURI="item:Body" />
                         <t:Item>
                            <t:Body BodyType="HTML">Some notes here.</t:Body>
                         </t:Item>
                      </t:SetItemField>
                      <t:SetItemField>
                         <t:FieldURI FieldURI="task:StartDate" />
                         <t:Task>
                            <t:StartDate>2016-03-02T21:18:00+03:00</t:StartDate>
                         </t:Task>
                      </t:SetItemField>
                      <t:DeleteItemField>
                         <t:ExtendedFieldURI DistinguishedPropertySetId="Task" PropertyId="33029" PropertyType="SystemTime" />
                      </t:DeleteItemField>
                      <t:SetItemField>
                         <t:FieldURI FieldURI="item:ReminderIsSet" />
                         <t:Item>
                            <t:ReminderIsSet>false</t:ReminderIsSet>
                         </t:Item>
                      </t:SetItemField>
                      <t:SetItemField>
                         <t:FieldURI FieldURI="task:CompleteDate" />
                         <t:Task>
                            <t:CompleteDate>2016-03-02T22:47:00+03:00</t:CompleteDate>
                         </t:Task>
                      </t:SetItemField>
                      <t:SetItemField>
                         <t:FieldURI FieldURI="task:Status" />
                         <t:Task>
                            <t:Status>Completed</t:Status>
                         </t:Task>
                      </t:SetItemField>
                      <t:SetItemField>
                         <t:FieldURI FieldURI="item:Importance" />
                         <t:Item>
                            <t:Importance>High</t:Importance>
                         </t:Item>
                      </t:SetItemField>
                   </t:Updates>
                </t:ItemChange>
             </m:ItemChanges>
          </m:UpdateItem>
       </soap:Body>
    </soap:Envelope>



    Friday, March 4, 2016 4:40 AM
  • >> I tried your method but unfortunately the due date field remain as it is.

    I think for OWA you need to include the CommonEnd property as well so try deleting

    <t:ExtendedFieldURI DistinguishedPropertySetId="Common" PropertyId="34071" PropertyType="SystemTime" />

    >> Another question: I searched the web for the list of property ids, but no luck. Please guide me.

    There is a full list on https://msdn.microsoft.com/en-us/library/cc433490(v=exchg.80).aspx , I would however suggest you learn to use a MAPI editor like MFCMapi or OutlookSpy this will let you see/manipulate all the properties that exist on a particular Exchange Object. The protocol documents for the particular item type are also very useful

    Cheers
    Glen

    Monday, March 7, 2016 5:53 AM