2

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>

  • Can you post more details regarding how you have defined the field in the definition? – RJ Cuthbertson Jun 14 '13 at 18:41
1
+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;
        }

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.