1

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

2

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

| improve this answer | |
  • Just so I understand this. If I just want to add additional fields or modify existing fields, I can leave Inherits="TRUE" but to utilize custom forms I need to set it to Inherits="FALSE"? (And as a side effect of turnign off inheritance I need to redefine all the fields...) So the new <XMLDocuments> area is ignored if Inherits is set to TRUE? – Jason Feb 26 '14 at 19:22
  • That is my experience, yes. – Paul Schaeflein Feb 26 '14 at 19:40
  • Thank you Paul. That was the solution. After your response I modified my Google searches based on that and it seems that only a few articles explicitly point the Inherits=False out whereas the rest do not. To make it worse, many articles actually have it set to True. – Jason Feb 26 '14 at 21:17
  • Oddly enough, setting the Inherits=False still brings in the parent fields. Is this by design? Does that make sense? – Jason Feb 26 '14 at 21:18
  • 2
    It does not make sense, but that is par for the course in SharePoint sometimes. :) I make is a practice to copy fields always just to be sure. Glad it's working. – Paul Schaeflein Feb 26 '14 at 21:34
0

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.