This topic has not yet been rated - Rate this topic

Method Element (View)

Published: May 2010

Used in batch processing to specify commands within the Batch element.


<Method ID="Text"
  Cmd = "Text"
  ID = "Text">
</Method>

Attribute

Description

Cmd

Optional Text. Used in Web services to specify the command to post to the server for updating list items. Possible values include the following:

  • Delete — Delete the specified item.

  • New — Create the specified item.

  • Update — Modify the specified item.

ID

Required Text. A freeform identification string that is not actually used by the server but that is returned to the client.

Minimum: 1

Maximum: Unbounded

The Method element is required for the Batch element, which is embedded within HTTP protocol and allows the client application to post more than one command at a time to the server.

In operations where the SetVar element is used within the Method element to post commands, the Cmd attribute can contain methods in the SharePoint Foundation RPC Protocol protocol.

When used with the UpdateListItems method of the Lists Web service, each Method element contains Field elements that specify the column values for each item being updated.

The following example uses the Method element to post the remote procedure call (RPC) ExportList command and return the schema of a specified list.

<Batch OnError="Return">
  <Method ID="0,ExportList">
    <SetList Scope="Request">EF2F5A21-0FD0-4654-84ED-
        112B4F5A48F8</SetList>
    <SetVar Name="Cmd">ExportList</SetVar>
  </Method>
</Batch>

Date

Description

Reason

May 2010

Initial publication

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Addition Cmd Attribute Value
Cmd='Moderate'
  • Moderate - Used when performing approval of an item/folder.  Field value of 0 = approved.
Example:
   <Method ID='1' Cmd='Moderate'>
      <Field Name='ID'>6</Field>
      <Field Name='_ModerationStatus' Type='ModStat'>0</Field>
      <Field Name='_ModerationComments' Type='Note'>Item approved by a web service call.</Field>
   </Method>