Save 方法 (RPC)

上次修改时间: 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"

指定要在其中添加或修改值的列的名称。根据列表和执行的操作,可以指定不同的列。

默认情况下,在对各种列表执行的操作中将使用以下列。

创建或修改通知列表中的项目。

  • Title   用于指定项目标题的文本。

  • Body   用于指定项目的消息正文的文本。

  • Expires   DateTime 值,其格式为 ISO8601,用于指定过期日期。例如,2003-06-16T18:37:44Z。

创建或修改联系人列表中的项目。

  • Title   用于指定姓氏的文本。

  • FirstName   用于指定名字的文本。

  • Email   用于指定电子邮件地址的文本。

  • Company   用于指定公司的文本。

  • JobTitle   用于指定职务的文本。

  • WorkPhone   用于指定工作电话号码的文本。

  • HomePhone   用于指定家庭电话号码的文本。

  • CellPhone   用于指定手机号码的文本。

  • WorkFax   用于指定单位传真号码的文本。

  • WorkAddress   用于指定工作地址的文本。

  • WorkCity   用于指定联系人工作地所在的城市的文本。

  • WorkState   用于指定联系人工作地所在的省/州的文本。

  • WorkZip   用于指定联系人工作地的邮政编码的文本。

  • WebPage   用于指定网站的 URL 的文本。

  • Comments   用于指定有关联系人的备注的文本。

创建或修改讨论板中的项目。

  • ThreadID   用于指定讨论的线程 ID 的 GUID。

  • Ordering   用于指定讨论的时间戳的文本。初始注释的排序是一个字符串,如 20031211164930;而回复的排序是一个包含初始排序的字符串,如 2003121116493020031211164951。若要修改现有讨论板项目,请通过 ID 参数指定项目的 ID,通过 ThreadID 参数指定讨论的线程 ID,并通过 Ordering 参数指定项目的排序。若要在现有讨论中创建回复,请将 New 指定为 ID 参数的值,通过 ThreadID 参数指定线程 ID,并使用 Ordering 参数指定响应的注释的排序。若要创建新的讨论,请将 New 指定为 ID 参数的值,并传递一个空的 Ordering 参数。

  • Title   用于指定讨论项目的主题的文本。

  • Body   用于指定讨论项目的消息正文的文本。

编辑文件或文件夹的名称。

  • Title   用于指定文件或文件夹的标题的文本。使用 owsfileref 参数可指定文件或文件夹的 URL,并且使用 owsnewfileref 参数可指定一个新名称。必须通过 ID 参数指定文件或文件夹的 ID。

创建或修改事件项目。

所有事件项目共有的参数:

  • Title   用于指定事件的标题的文本。

  • EventDate   DateTime 值,其格式为 ISO8601,用于指定事件的开始日期和时间。例如,2004-06-15T09:00:00Z。

  • EndDate   DateTime 值,其格式为 ISO8601,用于指定事件的结束日期和时间。例如,2004-06-30T10:00:00Z。

  • Description   用于指定事件的说明的文本。

  • Location   用于指定事件的位置的文本。

定期事件共有的参数:

  • RecurrencePattern#Type:fRecurrence   用于指定定期事件的类型的整数。可能的值包括:

    • 0 — 无

    • 2 — 每天

    • 3 — 每周

    • 4 — 每月

    • 5 — 每年

  • RecurrencePattern#windowStart:fRecurrence   DateTime 值,其格式为 ISO8601,用于指定定期事件的开始日期。例如,2004-06-15T09:00:00Z。

  • RecurrencePattern#EndDateRangeType:fRecurrence   用于指定确定事件的结束日期的范围类型的整数。可能的值包括:

    • 0   无结束日期。

    • 1   在发生指定次数之后结束。要求指定 RecurrencePattern#repeatInstances:fRecurrence。

    • 2   到指定日期结束。要求指定 RecurrencePattern#windowEnd:fRecurrence。

  • RecurrencePattern#repeatInstances:fRecurrence   用于指定定期事件的实例数目的整数。

  • RecurrencePattern#windowEnd:fRecurrence   DateTime 值,其格式为 ISO8601,用于指定定期事件的结束日期。例如,2004-06-30T09:00:00Z。

每日定期事件:

  • RecurrencePattern#daily_dayFrequency:fRecurrence   用于指定事件的日频率的整数。例如,2 指定每两天。

每月定期事件:

  • RecurrencePattern#MonthlyRecurType:fRecurrence   用于指定每月重复的类型的整数。可能的值包括:

    • 0 — 每整数 月整数 天。要求指定 RecurrencePattern#monthly_day:fRecurrence 和 RecurrencePattern#monthly_monthFrequency:fRecurrence。

    • 1 — 每整数 月的 [第一天 | 第二天 | 第三天 | 第四天 | 最后一天] [星期日 | 星期一 | 星期二 | 星期三 | 星期四 | 星期五 | 星期六]。要求指定 RecurrencePattern#monthlyByDay_weekOfMonth:fRecurrence、RecurrencePattern#monthlyByDay_day:fRecurrence 和 RecurrencePattern#monthlyByDay_monthFrequency:fRecurrence。

  • RecurrencePattern#monthly_day:fRecurrence   用于指定每次在月的哪一天出现的整数(当 RecurrencePattern#MonthlyRecurType:fRecurrence 等于 0 时)。

  • RecurrencePattern#monthly_monthFrequency:fRecurrence   用于指定月频率的整数(当 RecurrencePattern#MonthlyRecurType:fRecurrence 等于 0 时)。例如,3 指定每 3 个月。

  • RecurrencePattern#monthlyByDay_weekOfMonth:fRecurrence   用于指定在月的哪一周出现的整数(当 RecurrencePattern#MonthlyRecurType:fRecurrence 等于 1 时)。可能的值包括:

    • 0 — 第一周

    • 1 — 第二周

    • 2 — 第三周

    • 3 — 第四周

    • 4 — 最后一周

  • RecurrencePattern#monthlyByDay_day:fRecurrence   用于指定在星期几出现的整数(当 RecurrencePattern#MonthlyRecurType:fRecurrence 等于 1 时)。可能的值包括:

    • 0 — 星期日

    • 1 — 星期一

    • 2 — 星期二

    • 3 — 星期三

    • 4 — 星期四

    • 5 — 星期五

    • 6 — 星期六

  • RecurrencePattern#monthlyByDay_monthFrequency:fRecurrence   用于指定月频率的整数(当 RecurrencePattern#MonthlyRecurType:fRecurrence 等于 1 时)。例如,4 指定每 4 个月。

每周定期事件:

  • RecurrencePattern#weekly_weekFrequency:fRecurrence   用于指定事件的周频率的整数。例如,2 指定每 2 周。

  • RecurrencePattern#weekly_multiDays:fRecurrence   用于指定每周事件在星期几出现的整数。可能的值包括:

    • 0 — 星期日

    • 1 — 星期一

    • 2 — 星期二

    • 3 — 星期三

    • 4 — 星期四

    • 5 — 星期五

    • 6 — 星期六

创建或修改问题列表中的项目。

  • Title   用于指定问题项目的标题的文本。

  • Status   用于指定问题的状态的整数。可能的值包括:

    • 1 — 未解决

    • 2 — 已解决

    • 3 — 已关闭

  • Priority   用于指定问题的优先级的整数。可能的值包括:

    • 1 — 高

    • 2 — 中

    • 3 — 低

  • Category   用于指定问题的类别的整数。可能的值包括:

    • 1 — 类别 1

    • 2 — 类别 2

    • 3 — 类别 3

  • AssignedTo   用于指定为其分配问题的用户的 ID 的整数。

  • Comment   用于指定问题的注释的文本。

  • DueDate   DateTime 值,其格式为 ISO8601,用于指定问题的截止日期。例如,2004-06-30T09:00:00Z。

  • RelatedIssue   用于指定相关问题的 ID 的整数。

创建或修改链接列表中的链接。

  • URL   用于指定链接的绝对 URL 的文本,后跟逗号 (,)、空格和要为链接显示的文本。如果未指定显示的文本,则显示 URL 字符串。

  • Comments   用于指定链接的注释的文本。

创建或修改任务列表中的项目。

  • Title   用于指定任务的标题的文本。

  • Status   用于指定任务的状态的文本。可能的值包括:

    • Not Started

    • In Progress

    • Completed

    • Deferred

    • Waiting on someone else

  • Priority   用于指定任务的优先级的文本。可能的值包括:

    • High

    • Normal

    • Low

  • PercentComplete   表示任务已完成的百分比的小数。

  • AssignedTo   用于指定为其分配任务的用户的 ID 的整数。

  • Body   用于指定任务项目的消息正文的文本。

  • StartDate   DateTime 值,其格式为 ISO8601,用于指定任务的开始日期。例如,2004-05-30T09:00:00Z。

  • DueDate   DateTime 值,其格式为 ISO8601,用于指定任务的截止日期。例如,2004-06-30T09:00:00Z。

Name = "owsfileref"

可选。指定要更改其名称的文件或文件夹的相对于服务器的 URL。使用 owsnewfileref 参数可指定新的名称。必须通过 ID 参数指定文件或文件夹的 ID。

Name = "owsnewfileref"

可选。指定由 owsfileref 参数指定的文件或文件夹的新名称。

Name = "fileupload0"

指定为项目添加的附件的路径。

解码

  1. 在讨论板中添加对项目的答复。

    <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>
    
  2. 创建一个新事件,该事件在 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>
    
  3. 向任务列表添加任务。

    <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>