Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
1  
Please, do not double post (stackoverflow.com/questions/7117972/…) –  Dribbel Aug 19 '11 at 14:00
add comment

2 Answers

up vote 0 down vote accepted

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)

share|improve this answer
    
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
add comment

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

share|improve this answer
    
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
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.