inherit content type

kong 41 Reputation points
2021-07-02T08:10:21.58+00:00

Hello

I am using sharepoint 2013. I have created a content type and it has a choice column, which has 3 options (a b c).

Now i want to create a sub site and this subsite need d,e options. So i determine to create sub content type.

but i am not clear with the inheritance. am i able to expand the choice column to have abcde options? Or i need to create a new column?

Thanks

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,370 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,619 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. sadomovalex 3,631 Reputation points
    2021-07-02T14:50:26.317+00:00

    choice field has it choices defined in field definition. I.e. if you will inherit base CT - by default your new CT will have the same choices. However also each CT contains own copy of each field in Fields property: How to: Reference a Column in a Content Type

    The SPContentType object also has a Fields property that returns an SPFieldCollection object. You cannot add columns directly to this collection. When you add an SPFieldLink object to the FieldLinks collection, a corresponding SPField object is added automatically to the Fields collection. Each SPField object in this collection represents a "merged view" of the base column definition and any overwritten properties that are specified in the column reference.

    So what you may try is to find reference on this choice field in inherited CT in it's Fields property and add more choices there programmatically. It should not affect base CT.

    0 comments No comments

  2. Allen Xu_MSFT 13,831 Reputation points
    2021-07-05T07:10:52.157+00:00

    Hi @kong ,

    As per my test, if you edit the choice column in the inherited content type, the source column will in the parent content type will be affected. As shown below, item22 inherited from item11, if I edit the options of choice column in item22 content type details page, the options of choice column in item11 are also modified.
    111811-test.gif

    You can expand the choice column to have abcde options if you want both the parent and inherit content types have abcde options. If you create a new column in the inherit content type, it will have two choice columns. You can remove the old one if you don't need it and that will not affect the parent content type.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.