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:
|
|
ID |
Required Text. A freeform identification string that is not actually used by the server but that is returned to the client. |
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.
- 6/10/2009
- Programmer Bill
- 6/10/2009
- Programmer Bill
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.
- 3/17/2009
- Ryan Steeno
- 2/17/2009
- _Clint
http://msdn2.microsoft.com/en-us/library/ms459050.aspx
- 5/28/2007
- Lee Richardson