如何使用ews将任务的截止日期更新为none [英] How to update a task's due date to none using ews
问题描述
我尝试将任务的DueDate更新为none。但我得到以下错误。任何人都知道如何使用ews将DueDate设置为无。 错误信息:
谢谢,
<
< m:UpdateItemResponseMessage ResponseClass = " 错误 " >
< m:MessageText > 更改说明中的对象必须包含一个且只能修改的属性。 < / m:MessageText >
< ; m:ResponseCode > ErrorIncorrectUpdatePropertyCount < / m: ResponseCode >
< m:DescriptiveLinkKey > 0 < / m:DescriptiveLinkKey >
< m:Items />
< / m:UpdateItemResponseMessage >
< / m:ResponseMessages >
我的代码:
//属性:截止日期更新
TaskType newDueDate = new TaskType ();
if (task.DueDateUtc!= null )
{
newDueDate.DueDate =(
DateTime )task.DueDateUtc;newDueDate.DueDateSpecified =
true ;}
else
{
newDueDate.DueDateSpecified =
}
< font color ="#2b91af"size = 2> SetItemFieldType updateDueDate = new SetItemFieldType ();
PathToUnindexedFieldType pathEndDate = new PathToUnindexedFieldType ();
pathEndDate.FieldURI =
UnindexedFieldURIType .taskDueDate;updateDueDate.Item = pathEndDate;
updateDueDate.Item1 = newDueDate;
任何
I try to update a task's DueDate to none. but i got the following error. anyone knows how to set the DueDate to none using ews. Error info:
Thanks,
<
<m:UpdateItemResponseMessage ResponseClass="Error">
<m:MessageText>An object within a change description must contain one and only one property to modify.</m:MessageText>
<m:ResponseCode>ErrorIncorrectUpdatePropertyCount</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:Items />
</m:UpdateItemResponseMessage>
</m:ResponseMessages>
my code:
//Property: Due date update TaskType newDueDate = new TaskType(); if (task.DueDateUtc != null)
{
newDueDate.DueDate = (
DateTime)task.DueDateUtc;newDueDate.DueDateSpecified =
true;}
else{
newDueDate.DueDateSpecified =
false;}
SetItemFieldType updateDueDate = new SetItemFieldType(); PathToUnindexedFieldType pathEndDate = new PathToUnindexedFieldType();pathEndDate.FieldURI =
UnindexedFieldURIType.taskDueDate;updateDueDate.Item = pathEndDate;
updateDueDate.Item1 = newDueDate;
Anyone?
这篇关于如何使用ews将任务的截止日期更新为none的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!