1

I need to create an item in a SharePoint list using Lists.UpdateListItems web service. I have created a batch method and populate it with these fields.

<Field Name="ContentType">Document</Field>
<Field Name="FileLeafRef">??????</Field>
<Field Name="Title">Doc1</Field>
<Field Name="LookupColumn"></Field>

I don't know how the FileLeafRef format looks like. when i write Doc1.txt for example, the service returns an error.

Any one has an idea.

Thank you for your help.

0

The FileLeafRef must contain the full path to the document.

But keep in mind that creating new documents in a doclib using Lists.UpdateListItems is not possible ([citation needed] && as far as i know)

  • Are you sure that the FileLeafRef must contain the full path of the document? Can you provide me a link that describes and explains the FileLeafRef field? – user3470 Aug 19 '11 at 18:55
  • Hmmmz, The examples I found use FileRef instead of FileLeafRef. The examples on MSDN use it: msdn.microsoft.com/en-us/library/… and here also the full path is used: stackoverflow.com/questions/1372971/… – Dribbel Aug 19 '11 at 19:12
1

Maybe im wrong here, but i thought FileLeafRef only was used when query for items and not needed when creating them.

  • I need to set the item name. what field type should i choose? – user3470 Aug 19 '11 at 7:16
  • What do you mean with the item name, the Title? Check out: geekswithblogs.net/WayneMagnum/archive/2008/03/27/… maybe its to some help :) – Anders Aune Aug 19 '11 at 7:23
  • No i need the name that is displayed when the user view the list. If i don't set it the created item name will be his id plus underscore dot three zeros (ex: 99_.000) and the display will be 99_ – user3470 Aug 19 '11 at 7:29
  • The document name yes, now im following. If i remember correctly the internal name is BaseName for the Name field – Anders Aune Aug 19 '11 at 7:43
  • I tried it and got this error: 0x80070057 Bad parameter passed to Web Server Extensions. Check the information you entered and try again. – user3470 Aug 19 '11 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy