Posts

Showing posts with the label Content Type

Content Type Lookup Reference

Sure you can dig all over the 12 hive looking for content type IDs. In fact, you should probably do it at least once to get an idea of what SharePoint does and what files it uses, but after you've done that. Here's the easy way .

Custom list with content type item check-in throws "Value does not fall.." error

When checking in an item in a custom list, I was being presented with the following error: Value does not fall within the expected range. at Microsoft.SharePoint.SPFieldCollection.GetFieldByInternalName(String strName, Boolean bThrowException) at Microsoft.SharePoint.SPFieldCollection.GetFieldByInternalName(String strName) at Microsoft.SharePoint.SPListItem.get_MissingRequiredFields() at Microsoft.SharePoint.ApplicationPages.Checkin.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) After much head-scratching and nightmarish debugging, I found that the answer was very simple: Do not have the "Required" attribute set to true in your content type definition, but rather specify this in your custom list schema. Hope this helps!

Understanding Content Type IDs and a Reference

Microsoft provides a very thorough explanation of ContentTypes here but you may be left wondering what content types you can inherit from (or more likely what are their content type IDs) so you can build off of them. Well you can always go look at them in the 'ctypes' feature folder (that's the out-of-box feature that defines the WSS content types). It's available at under your 12\TEMPLATE\Features\ctypes folder in the 'ctypeswss.xml' file. Otherwise you can just refer to this list I pulled together: 0x : System 0x01 : Item 0x0101 : Document 0x010100629D00608F814dd6AC8A86903AEE72AA : ODCDocument 0x010100B4CBD48E029A4ad8B62CB0E41868F2B0 : UDCDocument 0x010101 : XMLDocument 0x010102 : Picture 0x010104 : UntypedDocument 0x010105 : MasterPage 0x010107 : DocumentWorkflowItem 0x010108 : WikiDocument 0x010109 : BasicPage 0x01010901 : WebPartPage 0x01010A : LinkToDocument 0x01010B : DublinCoreName 0x0102 : Event 0x0103 : Issue 0x0104 : Announcement 0x0105 : Link 0...

Adding a custom content type to a site definition

Today we'll be a adding a custom content type to our site definition we created in this post . The project that we're working with is an STSDEV project, so my project file structure reflects that. If you aren't using STSDEV you may need to make a few modifications. If you don't know what custom content types are, here's a good overview . The content type we develop here will extend the Document content type. We'll call it a Project Proposal. Now let's get to work. Step 1: Project Set up Aside from basing this project on the site definiton I created earlier, we'll need to add the Feature folders that reflect the structure on the server. Right click on the TEMPLATE folder in your project and choose 'Add New Folder', name this folder 'FEATURES'. Then add a folder under 'FEATURES' called 'ProjectProposalContentTypes'. Step 2: The feature definition file Since we want to deploy this as a feature we'll need to create the fe...