Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 136551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:57:59+00:00 2026-05-11T06:57:59+00:00

I got a question regarding content types and their IDs and how to use

  • 0

I got a question regarding content types and their IDs and how to use them with the object model.

First of all, I defined some site columns, a content type using these columns and a list definition using this content type via CAML. Each of the three components is realized as a feature. Another feature creates a list instance of this list definition.

So when I try to add a new item to the list using the my content type I use the following code.

 SPListItem listItem = list.Items.Add();  SPContentType type = list.ContentTypes[new ContentTypeId('0x010044fb4458c2eb4800825910845a35554c')];  listItem['ContentTypeId'] = type.Id;  listItem['Title'] = 'Titel';  listItem.Update(); 

When I execute this piece of code the type object is still null, also I’m sure the content type is attached to the list. Debugging the code and inspecting the list’s content types shows me that the content type attached to the list doesn’t have the id I defined in the content type definition (CAML). The id within the list instance is different but starts with the one I defined in the content type definition. 0x010044FB4458C2EB4800825910845A35554C0077D683BDD9969F4E920A27C334463321

So is this behavior normal? I expected the content type attached to the list to have the same id as in the definition.

My main goal is avoiding to use the name of the content type to retrieve it from the list’s content types, but to use the unique id.

bye Flo

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:58:00+00:00Added an answer on May 11, 2026 at 6:58 am

    When you create a list based on a content type, each instance of the list is actually a new content type that inherits from the parent.

    Take a look at this… http://soerennielsen.wordpress.com/2007/09/11/propagate-site-content-types-to-list-content-types/

    Update-Regarding finding the instance of the List without using the name, take a look at the SPContentTypeUsage class also!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

got a question regarding serializing classes that I've defined. I have some classes like
I've got an object[] array which contains some mixture of builtin types, like Int/Byte/String,
I've got a question regarding the difference between PropertyPlaceholderConfigurer (org.springframework.beans.factory.config.PropertyPlaceholderConfigurer) and normal filters defined
I got a question regarding C++ Object & Javascript Object life cycle mis-synchronization and
got a question regarding printing out the 128 first characters from the ascii table.
I got another question regarding jQuery's architecture. $('div') constructs a new jQuery object: $('div')
I recently posted a question regarding moving multiple images and got some advice from
Got a question regarding best practices for doing parallel web service calls, in a
I've got a question regarding a SQL-select-query: The table contains several columns, one of
I've got another question regarding to basic Android programming: How can I access the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.