Add a custom content type to a custom list definition

To add a custom content type to a custom list definition , the simple way to do is to add some entries in the schema.xml of the list.

Just add the ContentTypeRef of the contents types you want to use:

  • Add the DisallowContentTypes=”FALSE tag to the Elements.xml for the list;
  • Add the EnableContentTypes=”TRUE tag to the List Definition Schema.xml;

Sometimes i don’t really know the reason but some of the fields are not shown when trying to create a new item in the list.

I solved this problem by copying the field definition in the contents type to the schema.xml of the list. and it works fine.

Advertisements

Posted on 19/08/2015, in SharePoint and tagged , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: