Welcome to Office and SharePoint Pro Sign in | Join | Help
in Search

SUBSCRIBE to Windows IT Pro Magazine & SAVE 30%      FREE Email Newsletters Vista UPDATE, Windows IT Pro UPDATE & More

Folders in a list

Last post 06-06-2007, 8:41 AM by irGerard. 0 replies.
Sort Posts: Previous Next
  •  06-06-2007, 8:41 AM 28411

    Folders in a list

    I have added a list which can contain links on a MOSS portal. This list can contain folders. How do i add items to a folder using the webservice?

    With the following i can add items to the root of the list:

    string sBatch = string.Empty;
                    sBatch = "<Method ID=\"1\" Cmd=\"New\">";
                    sBatch += "<Field Name=\"ID\">New</Field>";
                    sBatch += string.Format("<Field Name=\"Title\"><![CDATA[{0}]]></Field>", item.Title);
                    sBatch += string.Format("<Field Name=\"URL\"><![CDATA[{0}]]></Field>", item.Url);
                    sBatch += string.Format("<Field Name=\"Comments\"><![CDATA[{0}]]></Field>", item.Comments);

                    System.Xml.XmlDocument xDoc = new System.Xml.XmlDocument();
                    System.Xml.XmlElement xBatch = xDoc.CreateElement("Batch");
                    xBatch.SetAttribute("OnError", "Return");
                    xBatch.InnerXml = sBatch;

    What do i need to change/add to place a item in a (sub)folder?

    Gerard

View as RSS news feed in XML
SPONSORED LINKS FEATURED LINKS

Order Your Fundamentals CD Today!Get up to speed quickly and learn how to uncover rich information management capabilities with this free SharePoint CD. IT ConnectionsDive into the new Microsoft platforms and products you implement and support with the experts from Microsoft, TechNet Magazine, Windows ITPro and industry gurus. There are 70+ sessions and interactive panels with networking opportunities. Attention User Groups & User Group Leaders...Announcing the eNews Generator—a FREE HTML e-newsletter builder for user group leaders. Build your HTML and text e-newsletters in minutes. And add Windows IT Pro & SQL Server Mag articles alongside your own message!. Get Specialized SharePoint Training!SharePoint MVPs Dan Holme, Michael Noel, and Andrew Connell share their perspective and expertise in these exclusive eLearning seminars. One Event for developers and one for IT pros. Choose the one that fits your needs! Get SQL Server 2008 at SharePoint ConnectionsDon’t miss SharePoint Connections, the premier event for Microsoft IT Professionals, in Las Vegas, November 10-13. Every attendee will receive a copy of SQL Server 2008 Standard Edition with one CAL.