Take the 2-minute tour ×
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
    
Did you finally found a solution? I have the same problem. –  Davy May 27 '13 at 9:38
    
Unfortunately not, I did not find any way to resolve the issue (or at least I don't remember how I fixed it) sorry. –  danbord May 27 '13 at 17:13

2 Answers 2

I just posted an answer on a similar question that I think is the same root cause:

Random Hidden Fields On New Content Type

share|improve this 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.