1

I've two Content Types, both are inherited from "Item" and both Contain the Same Field called "Analysis". This is a Managed Metadata Field.

When I want to add both Content Types to the same list with code, it gives a Duplicate Field with Guid was found. When I do it manually it works perfectly.

How do I resolve this issue without removing fields, because It should be possible to attach two different content types to a List with the same Site Column.

Thanks

SPContentTypeId TechnischOntwerpITContentTypeId = new SPContentTypeId("0x01010052058EBC1E246941ABEF9769C52BCB960A02");
SPContentTypeId FunctioneelOntwerpITContentTypeId = new SPContentTypeId("0x01010052058EBC1E246941ABEF9769C52BCB960A03");
list.ContentTypes.Add(web.Site.RootWeb.ContentTypes[TechnischOntwerpITContentTypeId]);
list.ContentTypes.Add(web.Site.RootWeb.ContentTypes[FunctioneelOntwerpITContentTypeId]);
  • Please add the code you use to add CT to list. – Andrey Ungur Dec 20 '13 at 10:07
0

What I had to do is to remove manual all MMS Site Columns from the Site.ContentTypes. Add the Site Column manual to the list with the AddToAllContentTypes option.

When done this, I had to reset the Site Content Types in order to function it properly. It is not possible to add the Site Content Types with code, xml or what so ever to the list. It will always return with A Duplicate Field message.

Luckily I could Refresh my Content Types from the CT Hub, and the Content Types restore in the previous mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.