2
votes

I'm creating Document Libraries in SharePoint with the Webservice Lists.AddList method through a C#.Net application. (See below)

listsService.AddList(listTitle, listDescription, 101);

I would like them to show up in the Quick Launch menu under the site they're created in rather than just the 'All Site Content' menu.

I've had a look at the Lists.UpdateList() Method, but without much luck.

Does anyone know how to do this through Web Services? (It cannot be done manually as there are far too many lists to change).

I'm using the latest version of SharePoint Server and Web Services.

Thankyou :)

3

3 Answers

2
votes

I believe you are correct that setting OnQuickLaunch isn't available through the web service. Setting OnQuickLaunch in listProperties for UpdateList is what I would try, but it sounds like that doesn't work.

If your lists didn't already exist, I would suggest creating a feature with a list template with OnQuickLaunch="true" and adding the lists via AddListFromFeature. Your other option would seem to be to write your own service to set the property through the object model.

2
votes
XmlDocument xmlDoc = new System.Xml.XmlDocument();

XmlNode ndProperties = xmlDoc.CreateNode(XmlNodeType.Element, "List", "");

XmlAttribute ndQuickLaunchAttrib = (XmlAttribute)xmlDoc.CreateNode(XmlNodeType.Attribute, "OnQuickLaunch", "");

ndQuickLaunchAttrib.Value = "True";

ndProperties.Attributes.Append(ndQuickLaunchAttrib);

XmlNode ndReturn = proxy.UpdateList("12345", ndProperties, null, null, null, null);
0
votes

Best is to create a SPList object first an then perform OnQuickLaunch="true". Don't forget the update command!

Example:
Guid listID = Guid.Empty;
listID = siteObject.Lists.Add("Title","Description",listTemplateObject);
//This will work:
SPList thisList = siteObject.Lists[ListID];
thisList.OnQuickLaunch = true;
thisList.Update();