似乎是一堆方式来添加自定义表单到列表和库,但最简单的方法似乎是在定义一个定义的Elements.xml文件中指定它给定世代古典etagcode。(如果这种理解不正确,请,请纠正我,并将我指向更好的资源,而不是我找到的资源。

使用Visual Studio 2013针对SharePoint 2010实例,我已经定义了以下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>
.

您可以看到我在查看列表项并编辑列表项时,我已经使用了要使用的新表单。

问题是未使用自定义表单,并且该项目继续使用默认表单。正如您所看到的,列表项是正确的类型

有帮助吗?

解决方案

需要将Inherits属性设置为false,然后手动包含所有列。

其他提示

我有同样的问题,我解决了以下问题: 注释出“XMLDocuments”的块, 设置列表的内容类型,以及在设置内容类型后查找列表的架构文件文件时,查找相同的行注释。 所以我将它们从架构和类型中取消注释它们,并且我部署并工作正常。

许可以下: CC-BY-SA归因
scroll top