Ad

Sharepoint- Inserting In A List Subfolder

- 1 answer

How can I insert a list item in a folder within a list, using list web services (UpdateListItem).

The breadcrumb of the folder would be something like this. [My site] > [My list] > [My sub folder]

I have tried with a CAML like this:

 <Batch PreCalc="TRUE"
 OnError="Continue"
 RootFolder="/Lists/MyList/MySubFolder">
 <Method ID="1" Cmd="New">
       <Field Name="Title">Gent</Field>
       <Field Name="PostalCode">9000</Field>
       <Field Name="TelephoneZone">09</Field>   
</Method> </Batch>

But unsuccessfully.

I am getting as response: Invalid URL value.
**If I remove the RootFolder attribute it works fine, but the item gets inserted outside the folder.

Ad

Answer

Problem solved.

The "RootFolderAttribute" should not be RootFolder="/Lists/MyList/MySubFolder" but "/sites/MySite/Lists/MyList/MySubfolder"

Could solved it thanks to a tool named u2u CAML Query Builder.

Ad
source: stackoverflow.com
Ad