4

After deploying a solution and activating a Site scoped feature that has Field definitions and Content Type definitions, I see all the content types and all the fields except one, when going to Site Settings -> Site Columns.

The field is used in only one content type, and if I look at the content type, I can see the field listed as part of the content type, but the name of the field in the content type is not linked to the field settings page for that field.

I can get the field in Powershell using SPWeb.Fields.GetFieldByInternalName, so I know it deployed as part of the feature.

What is wrong with this field definition that is preventing the field from showing up normally or being editable?

<Field ID="{GUID}"
       Name="WeekNumber"
       DisplayName="Week Number"
       Group="My Columns"
       Type="Integer"
       Min="1"
       Max="5" />
2

So I found this blog post that talks about having the same problem:

You will notice at this point that if you deploy your site column into SharePoint something has gone wrong. Your site column is not listed in the Site Column Gallery. The deployment must have failed then? But no, a quick look at the site columns via the API reveals that the column is there. What new evil is this? Unfortunately the base type for integer fields has this lovely attribute set on it:

UserCreatable = FALSE

So WSS 3.0 accordingly hides your field in the gallery as you cannot create fields of this type.

However!

You can use them in content types just like any other field (except not in the browser UI), and if you add them to the content type as part of your feature then they will show up in the UI as a field on that content type.

So I guess there's nothing really wrong with that field definition after all.

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.