Custom Form Template is not being used in SharePoint 2010

gaotter
  • Custom Form Template is not being used in SharePoint 2010 gaotter

    I have tried to create a custom form template but without success. I have followed several tutorials but it still does not use the custom template. If I change the template id to override the 'ListForm' it works. So I'm thinking that I've done something wrong in the content type definition. Here is the code:

       <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Field ID="{9381E2BE-CE62-4673-9C0D-8A7E4B087B55}" Name="MyPal" DisplayName="My Pal" Type="Text" />
      <!-- Parent ContentType: Item (0x01) -->
      <ContentType ID="0x01009dea68f3be5946789ab1a8ac699fcb8f"
                   Name="UnderstadingContentTypes - MyContentType"
                   Group="Custom Content Types"
                   Description="My Content Type"
                   Inherits="TRUE"
                   Version="0">
        <FieldRefs>
          <FieldRef ID="{9381E2BE-CE62-4673-9C0D-8A7E4B087B55}" Name="MyPal" DisplayName="My Pal" />
          <FieldRef ID="{77EEC76F-561A-422B-8975-21DCB2EC6C7B}" Name="External" DisplayName="external"/>
        </FieldRefs>
        <XmlDocuments>
          <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
            <FormTemplates  xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
              <Display>MyCustomForm</Display>
              <Edit>MyCustomForm</Edit>
              <New>MyCustomForm</New>
            </FormTemplates>
          </XmlDocument>
        </XmlDocuments>
    
        <!--<XmlDocuments>
          <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v4/contenttype/forms">
            <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v4/contenttype/forms">
              <Display>MyCustomForm</Display>
              <Edit>MyCustomForm</Edit>
              <New>MyCustomForm</New>
            </FormTemplates>
          </XmlDocument>
        </XmlDocuments>-->
      </ContentType>
    </Elements>
    

    And here is the template code. It is just made to show that it works:

    <%@ Control Language="C#"   %>
    <%@Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.WebControls"%>
    <%@ Register TagPrefix="wssuc" TagName="ToolBar" src="/_controltemplates/ToolBar.ascx" %>
    <%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="/_controltemplates/ToolBarButton.ascx" %>
    
    
    <SharePoint:RenderingTemplate id="MyCustomForm" runat="server">
    <Template>
    Hello My Template
    </Template>
    </SharePoint:RenderingTemplate>
    

  • I had a problem getting my workflow to use a custom task form template that I deployed. The problem was that I was not inheriting from the Workflow Task ContentType properly. I had to prepend the content type id with the task id (0x010801), but I also had to append that ID with two zeros. (I could not find the rational for that, but it was neccessary.) Using that same rational, what happens if you pad your ContentType ID?

    Also, are you also deploying your template form? (e.g. MyCustomForm)?

    Here is the code snippet for my Task Form that I was able to use in replace of a workflow task form:

      <!-- Field Elements -->
      <Field ID="{9781B75F-FDB2-4523-9516-9B6FF1DC5930}"
        Name="VID"
        DisplayName="VID"
        Group="My Task Content Type Columns"
        Type="Text"
        Required="FALSE">
      </Field>
    <!-- Parent ContentType: Task + 00 (0x01080100) -->
      <ContentType ID="0x01080100283F3E837128472399895F22E79FC50C"
                 Name="My Task ContentType"
                 Group="My Content Types"
                 Description="My Task Content Types"
                 Version="0"
                 Hidden="FALSE">
        <FieldRefs>
          <!-- Fields (match GUID with FieldID)-->
          <FieldRef ID="{9781B75F-FDB2-4523-9516-9B6FF1DC5930}"></FieldRef>
        </FieldRefs>
        <!-- Custom Task Form definition-->
        <XmlDocuments>
          <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
            <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
              <New>_layouts/MyTaskForm/TaskForm.aspx</New>
              <Display>_layouts/MyTaskForm/TaskForm.aspx</Display>
              <Edit>_layouts/MyTaskForm/TaskForm.aspx</Edit>
            </FormUrls>
          </XmlDocument>
        </XmlDocuments>
      </ContentType>
    

Tags
custom-form content-type
Related questions and answers
  • ), the list form suddenly works correctly. This makes me think there's something wrong with my content type. Here's what I'm working with. Some names have been changed to protect the innocent. &lt;ContentType...="{CE8F7528-E643-4473-94E0-BAA57BD2F6E6}"/&gt; &lt;FieldRef ID="{E508D1FA-D3A5-4e91-828B-3BFB43D4F7C5}"/&gt; &lt;/FieldRefs> &lt;XmlDocuments> &lt;XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms"&gt; &lt;FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms"&gt; &lt;Display>ListForm</Display> &lt

  • ;metaData> &lt;type name="Microsoft.SharePoint.WebPartPages.SPUserCodeWebPart, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" /&gt; &lt...;Codezeven.Social.Views, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c56ab109c2917056&lt;/property> &lt;property name="TypeFullName" type="string"&gt...;/PartImageLarge> &lt;IsIncludedFilter /&gt; &lt;Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&lt;/Assembly> &lt;TypeName>

  • ;/table> &lt;/xsl:template>; &lt;xsl:template name="dvt_1.formactions"&gt; &lt;td nowrap="nowrap" class="ms-vb"&gt; &lt;input type="button" value="Save Draft" name="btnSave...Hello I really need help with this... , I am using Sharepoint 2007. I have the 'collect data from user' action in a workflow - which generates a custom form within the workflow folder. The form...;DataSources> &lt;SharePoint:SPDataSource runat="server" DataSourceMode="ListItem" UseInternalName="true" selectcommand="&lt;View&gt;&lt;ViewFields&gt;&lt;FieldRef Name

  • I have a content type defined in Elements.xml and I want to add an Event Receiver. My Elements.xml looks like this: &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt; &lt;!-- Parent ContentType: Announcement (0x0104) --&gt; &lt;ContentType ID="0x0104008a424de98660457481eb7d8ddb5161ee" Name="News Posting...;FieldRefs> &lt;FieldRef ID="{7EBC5918-CB79-440A-8DF3-480C6951C4EB}" Name="NewsExcerpt"/&gt; &lt;/FieldRefs> &lt;XmlDocuments> &lt;XmlDocument NamespaceURI="http

  • ="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal"&gt; &lt;xsl:template match="FieldRef[@FieldType='DataLinkUrl']" mode="Note_body"&gt; &lt;xsl:param name="thisNode" select="."/&gt; &lt;xsl...Has anybody upgraded an old custom field type to use the new XSL transform in SharePoint 2010? I have a multi-column field type, and want the Display pattern to render the 2nd "column", which... confirm (or deny) that the following looks legitimate (or suggest a better way to do it)? &lt;xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint

  • in-browser and they are visible in SPDesigner, but when I "View All Site Content" they are not there. Why is this the case? The Feature's Elements File: &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Elements Id="9e85eb79-6d8d-4ff3-b0d4-64d55c3bb577" xmlns="http://schemas.microsoft.com/sharepoint/"&gt; &lt;Module Name="Pages" Url="Pages"&gt; &lt;File Path="Example.aspx" Url...;/Module> &lt;/Elements> The Aspx File: &lt;%@ Page language="C#" Inherits="System.Web.UI.Page,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" MasterPageFile

  • , Culture=neutral, PublicKeyToken=1de0ffdb1fdf1b80" ReceiverClass="MyApp.WebServices.TooltipsReceiver" xmlns="http://schemas.microsoft.com/sharepoint/"&gt; &lt;ElementManifests> &lt..." /&gt; &lt;/ElementManifests> &lt;/Feature> elements.xml &lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt; &lt;/Elements>...I've created a Custom List ('Tooltips') in SharePoint. After this I used SPSource to reverse engineer the list into a feature. After installing and activating this feature, I want to add this list

  • I have this (an attempt to solve the task): &lt;xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes..."/&gt; &lt;xsl:value-of select="sum($Rows/@Distance[.!=''])" /&gt; &lt;/xsl:template>; &lt;/xsl:stylesheet> The result is: "NaN", so I figure that my XSLT is wrong. Question.../@Distance[1]"/&gt;&lt;/xsl:call-template>; &lt;xsl:template name="xsum"&gt; &lt;xsl:param name="currnode"/&gt; &lt;xsl:param name="res" select="0"/&gt; &lt;xsl

  • " xmlns="http://schemas.microsoft.com/sharepoint/"&gt; &lt;ElementManifests> &lt;ElementManifest Location="elements.xml"/&gt; &lt;/ElementManifests> &lt;/Feature> Element.xml &lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt; &lt;Module Name="WebPartPopulation" Url="_catalogs/wp" RootWebOnly="TRUE"&gt..."?&gt; &lt;Feature Id="5d910db3-5adf-4f8e-a102-05d5a1653c59" Title="FeatureWithReceiver" Description="Description for FeatureWithReceiver" Version="12.0.0.0" Hidden="FALSE

Data information