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 custom content type based on the Document Set content type. I have several custom columns added to this content type. For some reason one of them doesn't show up in the list of Shared Columns within the Document Set settings. This particular column is of type Choice. I'm able to manually add other Choice types of columns to the content type and they show up. What is the exact criteria for a column showing up in the list of Shared Columns within the Document Set settings?

In my case the column definition is (changed names since it should be irrelevant):
<Field Type="Choice"
ID="{E2D221B3-653E-4F00-9ECA-B3D7B67C7B35}"
Name="MyFieldName"
DisplayName="My Field"
Format="Dropdown"
ShowInNewForm="TRUE"
ShowInDisplayForm="FALSE"
ShowInViewForms="TRUE"
ShowInEditForm="FALSE"
ShowInListSettings="True"
ShowInVersionHistory="True"
ReadOnly="False"
Required="False"
StaticName="MyFieldName"
Hidden="False"
Group="My Fields">
<CHOICES>
<CHOICE>Choice 1</CHOICE>
<CHOICE>Choice 2</CHOICE>
<CHOICE>Choice 3</CHOICE>
<CHOICE>Choice 4</CHOICE>
</CHOICES>
</Field>

share|improve this question
    
Can you post more details regarding how you have defined the field in the definition? –  RJ Cuthbertson Jun 14 '13 at 18:41

1 Answer 1

up vote 1 down vote accepted
+50

The column is shared in Document Set if the following conditions are met:

Below is provided the helper method that could be used to determine if the specified field is shared or not:

 private static bool IsSharedField(SPField spField)
        {
            if (spField.ShowInVersionHistory && !spField.Hidden && !spField.ReadOnlyField)
            {
                if (spField.ShowInEditForm.HasValue)
                {
                    if (!spField.ShowInEditForm.GetValueOrDefault())
                        return false;
                }
                if (spField.ShowInNewForm.HasValue)
                {
                    if (!spField.ShowInNewForm.GetValueOrDefault())
                        return false;
                }
                if (spField.FieldValueType != null && !(spField is SPBusinessDataField))
                {
                    return true;
                }
            }
            return false;
        }
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.