Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a feature that does the following in the feature activation Code :

  • Creates a new SiteColumn (Type=Text, Hidden=False and Required =True)
  • Set the french version of the Name (using CurrentUICulture switching)
  • Create a new ContentType
  • Add the SiteColumn to the new Content Type
  • Create a new list
  • Attach the ContentType to the list

But that causes some unexpected behaviors.

Sometimes my Column in the list is Hidden=True, sometimes Required=False. It seems to be totally Random.

It seems related to the ContentType.FieldLinks.Add() since the values are wrong in the content type.

Anyone faced something like that before?

Thanks

share|improve this question
Try to set values in upper case - Hidden="FALSE" and Required="TRUE" – Alexander Aug 16 '12 at 16:47
I may have been unclear. That is done through code and those properties are boolean, I cannot set String values there. sorry. – danbord Aug 16 '12 at 18:30

1 Answer

  • Have you made the list content type enabled - SPList.ContentTypeEnabled?
  • Try to set the 'Required' property on the fieldlink from the content type and not directly on the site column itself
  • You don't have to set the 'Hidden' property, it's false by default.
share|improve this answer

Your Answer

 
discard

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

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