0

Like OOB,

Can we add Site Column to All Content Types using server object model?

Thanks

1

1 Answer 1

0

Try This

 SPList currentList = currentWeb.Lists["DocLib"]; SPField newField = currentList.Fields.CreateNewField(SPFieldType.Text.ToString(), "New Field2"); currentList.Fields.AddFieldAsXml(newField.SchemaXml, true, SPAddFieldOptions.AddToAllContentTypes); currentList.Update(); 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.