Question

There seems to be a bunch of ways to add custom forms to list and libraries but the easiest way seems to be to specify it in the Elements.xml file that defines a given ContentType. (If this understanding is incorrect, please, please correct me and point me to better resources than I have found.

Using Visual Studio 2013 against a SharePoint 2010 instance, I have defined the following ContentType

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Parent ContentType: Workflow Task (0x010801) -->
    <ContentType ID="0x010801003EE4B5580C5846B6BE74BFC41A663388"
             Name="Technical Review Task"
             Group="KB Article"
             Description="Content Type for Technical Review Tasks in KB Workflow"
             Inherits="TRUE"
             Version="0">
    <FieldRefs>
        <FieldRef ID="{5f8fe565-f627-4aed-b7b1-48e5bd2ec8ac}"
                  Name="TechnicalReviewAction"
                  DisplayName="Action"
                  Required="TRUE" />
        <FieldRef ID="{5f4f08ad-7f5b-4d5d-879c-50b416acae3d}"
                  Name="ActionComment" />
    </FieldRefs>
    <XmlDocuments>
        <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
            <FormUrls  xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
                <Display>Forms/KnowledgeBaseTaskDisplay.aspx</Display>
                <Edit>Forms/KnowledgeBaseTaskEdit.aspx</Edit>
            </FormUrls>
        </XmlDocument>
    </XmlDocuments>
</ContentType>

As you can see I have defined new forms to be used when viewing the list item and editing the list item.

The problem is that the custom forms are not used and the item continues to use the default forms. As you can see, the list item is of the correct type

ConfirmedContentTypeOnDefaultViewForm

Was it helpful?

Solution

You need to set the Inherits attribute to False and then manually include all of the columns.

OTHER TIPS

I had the same problem and i resolve them as following : Comment out the block of "XmlDocuments" , Set the content type of the liste and when you looking on the Schema.xml file of the list after setting the Content type you find the same line commented. So i uncomment them from the Schema.xml and from the content type and i deploy and it work fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top