views:

88

answers:

1

I've seen an example here: msdn but it's a little confusing.

So if I have a list definition with a field called "CustomField" and I want to update the "ShowField" attribute of this field to be true then I would do this:

XmlNode listNode = listService.GetList("MyList");
string version   = listNode.Attributes["Version"].Value;
string guid      = listNode.Attributes["Name"].Value;

XmlDocument xmlDoc = new XmlDocument();
XmlElement updateFields = xmlDoc.CreateElement("Fields");

string fieldXml = @"<Method ID="1"><Field Name="CustomField" ShowField="true" /></Method>";

updateFields.InnerXml = fieldXml;

XmlNode result = listService.UpdateList(guid, null, null, updateFields, null, version);

I'm confused because it would seem that you would need to provide a field element to indicate what field to update and then a value element to specify the new value.

Could someone clarify this please?

A: 

Incase anyone else is interested, I solved the problem. All of the field properties need to be provided in the tag - even when you aren't editing them. Then just tweak the one you want.

cyrix86