SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two content types that I want to use to more than one list.

I want to add a Field to ONLY one of those lists, but I want to add the field to both the content types of the list, without modifind the content types. If i only add the field to the list with the Lists.Create() method , the filed is added only to the first oh the content types.

I can use the FieldLink.Add() method but it will propagate the change also to the other lists.

Here is my code: it works for my list but it also propagate the change of the CT to the other lists.

SPList list = Lists.Create(web, Constants.LIST_NAME_TOPCLICKED, Constants.CT_ID_ARTICOLO_IMM);

if (list != null)


list.ContentTypes.Add(web.ContentTypes[new SPContentTypeId(Constants.CT_ID_ARTICOLO_VID)]);


list.Fields.Add(Constants.AF_VISUALIZZA, SPFieldType.Boolean, true);

SPField fld = list.Fields.GetField(Constants.AF_VISUALIZZA);             

SPFieldLink fl = new SPFieldLink(fld);         

SPContentType ct = list.ContentTypes[Constants.CT_AV];



ct = list.ContentTypes[Constants.CT_AI];





the field name is Constants.AF_VISUALIZZA the two contenttypes name are Constants.CT_AV and Constants.CT_AI.

how can i resolve this?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.