上次修改时间: 2015年3月9日
适用范围: SharePoint Foundation 2010
添加或修改列表中的项,或修改文档库中的文件夹或文件的属性。
此方法已被弃用,在以后的版本中可能不受支持。请改用以下 Web 服务方法:UpdateListItems(String, XmlNode) Web 服务方法。
<Method ID="Text">
<SetList Scope="Request">GUID</SetList>
<SetVar Name="Cmd">Save</SetVar>
<SetVar Name="ID">[New|Integer]</SetVar>
<SetVar Name="NextUsing">URL</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#
Column_1_Name">Value</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#
Column_2_Name">Value</SetVar>
.
.
.
<SetVar Name="owsfileref">URL</SetVar>
<SetVar Name="owsnewfileref">Name</SetVar>
<SetVar Name="fileupload0">URL</SetVar>
</Method>
参数
参数 |
说明 |
---|---|
ID = "Text" |
特定于应用程序的字符串。在与 Microsoft SharePoint Foundation 2010 兼容的 HTML 编辑器(如 Microsoft SharePoint Designer 2010)中,该字符串提供方法的序号和名称。 |
Scope = "Request" |
当设置为 Request 时,Scope 属性可设置封闭 Method 元素的作用域的变量,除非该变量被另一标记更改。 |
Name = "Cmd" |
必须设置为 Save。 |
Name = "NextUsing" |
可选。在操作完成之后将用户重定向到的 URL。 |
Name = "ID" |
设置为 New 以创建新的项目,或设置为要修改的项的整数 ID。 |
Name = "urn:schemas-microsoft-com:office:office#Column_Name" |
指定要在其中添加或修改值的列的名称。根据列表和执行的操作,可以指定不同的列。 默认情况下,在对各种列表执行的操作中将使用以下列。 创建或修改通知列表中的项目。
创建或修改联系人列表中的项目。
创建或修改讨论板中的项目。
编辑文件或文件夹的名称。
创建或修改事件项目。 所有事件项目共有的参数:
定期事件共有的参数:
每日定期事件:
每月定期事件:
每周定期事件:
创建或修改问题列表中的项目。
创建或修改链接列表中的链接。
创建或修改任务列表中的项目。
|
Name = "owsfileref" |
可选。指定要更改其名称的文件或文件夹的相对于服务器的 URL。使用 owsnewfileref 参数可指定新的名称。必须通过 ID 参数指定文件或文件夹的 ID。 |
Name = "owsnewfileref" |
可选。指定由 owsfileref 参数指定的文件或文件夹的新名称。 |
Name = "fileupload0" |
指定为项目添加的附件的路径。 |
解码
在讨论板中添加对项目的答复。
<Method ID="0,DiscSave"> <SetList Scope="Request">D1292FB0-20C9-4270-B5D9-5F2ECC6C597D</SetList> <SetVar Name="Cmd">Save</SetVar> <SetVar Name="ID">New</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#ThreadID">20031212-0429-16B3-919B-E69D9248868B</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#Title">Text</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#Ordering">2003121120293620031211204403</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#Body">Text</SetVar> </Method>
创建一个新事件,该事件在 2004 年内每两个月发生一次,发生的时间是月的第二个星期二的上午 10 点到下午 12:30 之间。
<Method ID="0,Save"> <SetList Scope="Request">c3fb93d0-2632-4b72-a0e2-1f571b869814</SetList> <SetVar Name="Cmd">Save</SetVar> <SetVar Name="ID">New</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#Title">Monthly Meeting</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#EventDate">2004-01-01T10:00:00Z</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#EndDate">2005-01-01T12:30:00Z</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#RecurrencePattern#Type:fRecurrence">4</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#RecurrencePattern#MonthlyRecurType:fRecurrence">1</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#RecurrencePattern#monthlyByDay_weekOfMonth:fRecurrence">1</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#RecurrencePattern#monthlyByDay_day:fRecurrence">2</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#RecurrencePattern#monthlyByDay_monthFrequency:fRecurrence">2</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#RecurrencePattern#EndDateRangeType:fRecurrence">2</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#RecurrencePattern#windowStart:fRecurrence">2004-01-01T00:00:00Z</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#RecurrencePattern#windowEnd:fRecurrence">2005-01-01T00:00:00Z</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#Description">Text</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#Location">Text</SetVar> </Method>
向任务列表添加任务。
<Method ID="0,Save"> <SetList Scope="Request">7DDA4B15-CFDE-4098-8288-EE139CC3796F</SetList> <SetVar Name="Cmd">Save</SetVar> <SetVar Name="ID">New</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#Title">Text</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#Status">In Progress</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#Priority">High</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#PercentComplete">.2</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#AssignedTo">17</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#Body">Text</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#StartDate">2004-01-01T00:00:00Z</SetVar> <SetVar Name="urn:schemas-microsoft-com:office:office#DueDate">2004-01-14T00:00:00Z</SetVar> </Method>