Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
SDK Documentation
General Reference
Reference
View Schema
M-S
 Method Element

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
Method Element (View)

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 Windows SharePoint Services RPC Protocol protocol.

When used with the UpdateListItems method of the websvcLists 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.

Xml
<Batch OnError="Return">
  <Method ID="0,ExportList">
    <SetList Scope="Request">EF2F5A21-0FD0-4654-84ED-
        112B4F5A48F8</SetList>
    <SetVar Name="Cmd">ExportList</SetVar>
  </Method>
</Batch>
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Field Element Link Incorrect      Lee Richardson   |   Edit   |   Show History
The Field element in the article incorrectly links to the list schema. It should link to the view schema here:
http://msdn2.microsoft.com/en-us/library/ms459050.aspx
Duplicate attribute in example      _Clint   |   Edit   |   Show History
It appears as though there are duplicate "ID" attribute values in the example.
Moderate Cmd - Undocumented      Ryan Steeno   |   Edit   |   Show History
There appears to be an undocumented value for the cmd attribute. In addition to Delete, New and Update, there is a Moderate value available.

When you need to update the "Approval Status" of a list item using the Lists.asmx web service, the following Method element can be used to set the Approval Status of the list item to Approved:

<Method ID='1' Cmd='Moderate'>
<Field Name='ID'>1</Field>
<Field Name='_ModerationStatus'>0</Field>
</Method>

If you try to update the _ModerationStatus with the Update Cmd, the call will succeed, but will NOT update the Approval Status field.
Two dialects of "Method"      Programmer Bill   |   Edit   |   Show History
There appear to be 2 distinct dialects of <Method>. One for the list service, and another for ProcessBatchData. To insert new records in ProcessBatchData I've found <SetVar Name="Cmd">Save</SetVar> along with <SetVar Name="ID">New</SetVar> the only way I've been able to insert new records.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker