Add a column to default view

Jan 30, 2014 at 3:27 PM
Hi,

I have been trying to add a column to a list and used the below code with the help from this forum. But when the column is created it not added to the default view of the list. Can any one help me to resolve the same please.

newFields='<Fields><Method ID="1"><Field Name="Region" DisplayName="Region" Type="Lookup" List="{F3EC84C6-2317-4A8F-9BA0-2AFA0E166B49}"/></Method></Fields>';

$().SPServices({
operation: "UpdateList",
listName: "TestList",
listProperties:"",
updateFields: "",
newFields: newFields,
deleteFields: "",
listVersion: "",
async: false,
completefunc: function (xData, Status){}

});
Jan 30, 2014 at 4:04 PM
You'll first want to verify that your column is added to the list. After that, you'll want to use the UpdateView operation. There's an example in the docs that will get you going:

https://spservices.codeplex.com/wikipage?title=UpdateView

Cheers,
Matthew