Friday, December 9, 2011

Add a new list item inside a folder using Sharepoint Webservice Lists.asmx


By using the following batch element you can create an item inside a folder present in a list or library.

<Batch OnError="Continue" RootFolder="http://moss/Lists/myList/FolderName">
  <Method ID="1" Cmd="New">
    <Field Name="ID">New</Field>
    <Field Name="CustomerName">Robert Hay</Field>
    <Field Name="CustomerAddress">Redmond</Field>
    <Field Name="Title">customer2</Field>
  </Method>
</Batch>
 
The important attribute here is the RootFolder. You need to provide the 
URL of the folder where you wish to create the item. So right now the 
RootFolder value is http://moss/Lists/myList/FolderName.
  
 
Hope this helps ..

No comments:

Post a Comment

Popular Posts