Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using the lists web service to add list items to folders in a list

1 view
Skip to first unread message

Doug

unread,
Feb 6, 2007, 8:39:01 PM2/6/07
to
I'm using a client app to post items to a custom list via the lists web
service. Due to the number of items exceeding 2000, I'd like to use folders
to overcome the recommended product limitations.

I've already implemented code to build the folder structure which works.

I've tested the code to add new items to the list via the UpdateListItems
(listname, XMLbatch) method and it works.

I now want to enhance the XMLbatch to add the item to the corresponding
folder, i.e. if the MYID value below begins with 100, add the item to the 100
folder of the list.

XMLbatch example:
"<Method ID=\"1\" Cmd=\"New\"><Field Name=\"ID\">New</Field><Field
Name=\"Title\">New list item unique title</Field><Field
Name=\"MYID\">100003</Field><Field Name=\"Status\"></Field><Field
Name=\"FileRef\">http://win2003r2-mossr:81/sites/mysite/Lists/MyList/100</Field></Method>"

However, when I attempt to do this the method fails to add the item if the
100 folder exists (which it does). If I remove the folder and execute the
same batch, it succeeds but ignores the FileRef element. Is there an
additional element or attribute that I need to pass for this to successfully
add the item to the folder or another way to accomplish my goal?

Note that using the object model is not an option in this case.

Thanks.

--
-Doug

Luke Zhang [MSFT]

unread,
Feb 6, 2007, 9:50:55 PM2/6/07
to
Hi Doug,

Would you please post more code on how you implement adding the item to the
100 folder of the list if he MYID value below begins with 100? For example,
the whole <Batch> section you passed to UpdateListItems() method. And, what
is the exception message, or what is the return message of
UpdateListItems() method?

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Doug

unread,
Feb 6, 2007, 10:52:01 PM2/6/07
to
Sure, the case in point is purely targeting one list item as the single
method of the batch at one folder (100). I first want to see that succeed.

The batch element looks like this:
<Batch><Method ID=\"1\" Cmd=\"New\"><Field Name=\"ID\">New</Field><Field

Name=\"Title\">New list item unique title</Field><Field
Name=\"MYID\">100003</Field><Field Name=\"Status\"></Field><Field

Name=\"FileRef\">http://win2003r2-mossr:81/sites/mysite/Lists/MyList/100</Field></Method></Batch>

The result is:
<Result ID=\"1,New\"
xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\"><ErrorCode>0x80040e2f</ErrorCode><ErrorText>The
operation failed because an unexpected error occurred. (Result Code:
0x80040e2f)</ErrorText></Result>

Sorry, I should have posted the result previously...does that help?

Also, if I browse to the FileRef Url, it does render the default view of the
target folder (albeit empty).

If you need a more detailed view of the code, I can share that with you
directly; please let me know if that would help.

--
-Doug

Luke Zhang [MSFT]

unread,
Feb 9, 2007, 12:17:32 AM2/9/07
to
Hello,

I tested your code on my side and I got similiar problem. Currently I am
performing further research on this issue. Meanswhile, you may take a look
at this article:

Adding a List Item inside a folder
http://blogs.msdn.com/harsh/archive/2006/08/12/695878.aspx

It adds the item with sharepoint pbject modal instead list service, can you
use this approuch as a work around?

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Doug

unread,
Feb 9, 2007, 9:30:02 AM2/9/07
to
Unfortunately, no, I cannot use the object model in this case. I do not have
access to the front end web server to execute the object model code.


Please let me know what your research yields...

--
-Doug

Luke Zhang [MSFT]

unread,
Feb 13, 2007, 7:23:09 AM2/13/07
to
Hello Doug,

Thank you for update. Currently I am consulting our internal resource to
see if we can find a solution for this issue. I will update you as soon as
possible. For better communicate on this issue, would you please let me
know your email? To get my actual email, please remove "online".

0 new messages