Condividi tramite


FieldRefs Element (ContentType)

Applies to: SharePoint Foundation 2010

Represents a collection of column references included in the content type.

<FieldRefs>
</FieldRefs>

Attributes

Attribute

Description

None

Child Elements

FieldRef

RemoveFieldRef

DocumentTemplate

Parent Elements

ContentType

Occurrences

Minimum: 1

Maximum: 1

Remarks

The FieldRefs element contains a collection of FieldRef elements. The FieldRef element is a reference to a column defined elsewhere, either at the site or list level. In the field reference, you can override a subset of the column properties, such as the following:

  • Display name

  • XML promotion and demotion attributes

  • Whether the field is read-only, required, or hidden

Changing these properties in the field reference only changes them as they apply to the specific content type that contains the field reference.

Note

The order in which FieldRef elements are listed determines the order of fields shown on NewForm.aspx.

The DocumentTemplate child element is obsolete. Instead use the DocumentTemplate element that is a child of the ContentType element.

For more information about field references, see Fields and Field References.

Example

The following example shows the field references collection for the Document content type.

<ContentType ID="0x0101"
    Name="$Resources:Document"
    Group="$Resources:Document_Content_Types"
    Description="$Resources:DocumentCTDesc"
    V2ListTemplateName="doclib"
    Version="0">
    <FieldRefs>
        <RemoveFieldRef ID="{67df98f4-9dec-48ff-a553-29bece9c5bf4}" Name="Attachments" /> <!-- Attachments -->
        <RemoveFieldRef ID="{f1e020bc-ba26-443f-bf2f-b68715017bbc}" Name="WorkflowVersion" /> <!-- WorkflowVersion -->
        <RemoveFieldRef ID="{bc91a437-52e7-49e1-8c4e-4698904b2b6d}" Name="LinkTitleNoMenu" /> <!-- LinkTitleNoMenu -->
        <RemoveFieldRef ID="{82642ec8-ef9b-478f-acf9-31f7d45fbc31}" Name="LinkTitle" /> <!-- LinkTitle -->
        <RemoveFieldRef ID="{ae069f25-3ac2-4256-b9c3-15dbc15da0e0}" Name="GUID" /> <!-- GUID -->
        <RemoveFieldRef ID="{de8beacf-5505-47cd-80a6-aa44e7ffe2f4}" Name="WorkflowInstanceID" /> <!-- WorkflowInstanceID -->
        <FieldRef ID="{5f47e085-2150-41dc-b661-442f3027f552}" Name="SelectFilename" /> <!-- SelectFilename -->
        <FieldRef ID="{8553196d-ec8d-4564-9861-3dbe931050c8}" Name="FileLeafRef" Required="TRUE"/> <!-- FileLeafRef -->
        <FieldRef ID="{8c06beca-0777-48f7-91c7-6da68bc07b69}" Name="Created" Hidden="TRUE" /> <!-- Created -->
        <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" Required="FALSE" ShowInNewForm="FALSE" ShowInEditForm="TRUE"/> <!-- Title -->            
        <FieldRef ID="{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}" Name="Modified"  Hidden="TRUE" /> <!-- Modified -->
        <FieldRef ID="{822c78e3-1ea9-4943-b449-57863ad33ca9}" Name="Modified_x0020_By" Hidden="FALSE"/> <!-- Modified_x0020_By -->
        <FieldRef ID="{4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb}" Name="Created_x0020_By" Hidden="FALSE" /> <!-- Created_x0020_By -->
     </FieldRefs>
    <XmlDocuments>
        <XmlDocument NamespaceURI="https://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
            <FormTemplates xmlns="https://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
                <Display>DocumentLibraryForm</Display>
                <Edit>DocumentLibraryForm</Edit>
                <New>DocumentLibraryForm</New>
            </FormTemplates>
        </XmlDocument>
    </XmlDocuments>
</ContentType>

See Also

Concepts

Content Type Definitions

Fields and Field References

Other Resources

Content Types