Field types

05/10/2012 18:21

Sharepoint Field Types - Elements.xml

taken from

https://sharpointpractice.blogspot.sk/2011/08/sharepoint-field-types-elementsxml.html

 
Single Line of Text: Text
field id="{FDDC4E38-25E0-4FD9-92E7-D17F34A5AB12}" description="My Content ID of Item" staticname="ContentID" name="ContentID" displayname="ContentID" type="Text" group="Sample Site Columns" sourceid="https://schemas.microsoft.com/sharepoint/v3"

Number: Number
Field ID="{13b3652a-d543-465d-91cb-a9d625637855}" StaticName="Read_Times" Name ="Read_Times" DisplayName ="Read_Times" Description="Read Time count of Item" Type="Number" Group ="Sample Site Columns" SourceID ="https://schemas.microsoft.com/sharepoint/v3"

Date Time:DateTime
Field ID="{d076e4d5-c785-4c04-8b56-c1f021721749}" StaticName="CreateDate" Name="CreateDate" DisplayName="Create_Date" Description="Create Date of Item" Group="Sample Site Columns" Type="DateTime" Format="DateOnly" SourceID="https://schemas.microsoft.com/sharepoint/v3/fields"

Multiple lines of text: Note
Field ID="{2ae59f08-0fb0-4a9c-8a31-a180161b1029}" StaticName="PublisherDescription" Name="PublisherDescription" Description="Publisher Description of Item" DisplayName="Publisher_Description" Type="Note" RichText="FALSE" NumLines="6" Group="Sample Site Columns" SourceID="https://schemas.microsoft.com/sharepoint/v3/fields"

Rich Text HTML: Note, RichTextMode: FullHtml
Field ID="{13cd0291-df15-4278-9894-630913e4d2b9}" StaticName="AccrediterDescription" Name="AccrediterDescription" DisplayName="Accrediter_Description" Description="Accrediter Description of Item" Type="Note" NumLines="6" RichText="TRUE" RichTextMode="FullHtml" Group="Sample Site Columns" SourceID="https://schemas.microsoft.com/sharepoint/v3/fields"

Publishing HTML:
Field ID="{E2CC0231-FA6C-4F90-839C-118C304DFCF1}" StaticName="PMediaDescription" Name="PMediaDescription" DisplayName="MediaDescription" Type="HTML" RichText="TRUE" RichTextMode="ThemeHtml" Group="Site Columns" SourceID="https://schemas.microsoft.com/sharepoint/v3" UnlimitedLengthInDocumentLibrary ="TRUE"

Publishing Image:
field id="{148e8191-afe7-4422-b1d1-7202eda667f1}" description="Image 1 link of Item" staticname="PImageID1" name="PImageID1" displayname="Image_ID1" type="Image" group="My Site Columns" sourceid="https://schemas.microsoft.com/sharepoint/v3" richtext="TRUE" richtextmode="ThemeHtml">


HyperLink & Image:
Field ID="{635a2031-2088-4413-b54e-d2af5daf08bf}" StaticName="ImageAuthor" Name="ImageAuthor" DisplayName="Image_Author" Description="Author Image" Type="URL" Format="Image" Group="Sample Site Columns" SourceID="https://schemas.microsoft.com/sharepoint/v3/fields"


YES/No Boolean:
0


CHOICES:

choice>Gold


MultiSelect:


Lookup Columns:
Field Type="Lookup" ID="{FE45AC76-C0E2-46C8-A047-E8C43C10315C}" Name="LU_Country" StaticName="LU_Country" DisplayName="LU_Country" Required="FALSE" List="Lists/Region Country Master" ShowField="RollOutCountry" UnlimitedLengthInDocumentLibrary="FALSE" SourceID="https://schemas.microsoft.com/sharepoint/v3/fields" Group="Sample Site Columns"

Multi Lookup Columns:
Field Type="LookupMulti" Mult="TRUE" ID="{85062ACF-315B-460A-B756-2230A5FE082F}" Name="LU_Language" StaticName="LU_Language" DisplayName="LU_Language" Required="FALSE" List="Lists/Language Master" ShowField="Title" UnlimitedLengthInDocumentLibrary="FALSE" SourceID="https://schemas.microsoft.com/sharepoint/v3/fields" Group="Sample Site Columns"

Lookup with Additional Field Lookup column:
Field Type="Lookup" ID="{9AA2985D-AA17-4EA2-9556-9B0E112A64F6}" Name="LU_ApplicationType" StaticName="LU_ApplicationType" DisplayName="LU_ApplicationType" Required="FALSE" List="Lists/Application Type" ShowField="ApplicationType" UnlimitedLengthInDocumentLibrary="FALSE" SourceID="https://schemas.microsoft.com/sharepoint/v3/fields" Group="Sample Site Columns"

Field Type="Lookup" ID="{668D51C4-804D-43E7-8211-950AE3BCD9A3}" Name="LU_ApplicationType_ID" StaticName="LU_ApplicationType_ID" DisplayName="LU_ApplicationType_ID" List="Lists/Application Type" ShowField="ApplicationTypeID" FieldRef="9AA2985D-AA17-4EA2-9556-9B0E112A64F6" ReadOnly="TRUE" UnlimitedLengthInDocumentLibrary="FALSE" SourceID="https://schemas.microsoft.com/sharepoint/v3/fields" Group="Sample Site Columns"
 
Taxonomy (taxonomy field and note hidden field) - term set mapping is done in codebehind
 <Field ID="{76924a2f-3f7b-4b6c-ba04-ed23999e2f5c}"
    Type="TaxonomyFieldType"
    DisplayName="MyTaxonomyField"
    ShowField="Term1033"
    EnforceUniqueValues="FALSE"
    Group="Lukas custom fields"
    StaticName="MyTaxonomyField"
    Name="MyTaxonomyField">
    <Customization>
      <ArrayOfProperty>
        <Property>
          <Name>TextField</Name>
          <Value xmlns:q6="https://www.w3.org/2001/XMLSchema"
              p4:type="q6:string"
              xmlns:p4="https://www.w3.org/2001/XMLSchema-instance">{96F95CDF-B03A-482B-BED1-0D94B42F1EAB}</Value>
        </Property>
      </ArrayOfProperty>
    </Customization>
  </Field>
 
  <Field Type="Note"
    DisplayName="MyTaxonomyNote"
    StaticName="MyTaxonomyFieldTaxHTField0"
    Name="MyTaxonomyFieldTaxHTField0"
    ID="{96F95CDF-B03A-482B-BED1-0D94B42F1EAB}"
    ShowInViewForms="FALSE"
    Required="FALSE"
    Hidden="TRUE"
    CanToggleHidden="TRUE"
    RowOrdinal="0"
    Group="Lukas custom fields" />

 
Calculated Field
<Field  ID="{668D51C4-804D-43E7-8211-950AE3BCD9A3}"

DisplayName="Date to text"

Name="FieldName"

StaticName="FieldName"

Group ="Custom Group"

Type ="Calculated"

Format ="DateOnly"

ResultType="Text">

<Formula>=TEXT(PublishingStartDate,"MMMM YYYY")Formula>

<FieldRefs>

<FieldRef ID="{51d39414-03dc-4bd0-b777-d3e20cb350f7}" Name="PublishingStartDate"/>

FieldRefs>

Field>

 

 

Attachment:

use 'DisableAttachments false for list in Schema.xml:

<List xmlns:ows="Microsoft SharePoint" ThumbnailSize="160" WebImageWidth="640" WebImageHeight="480" DisableAttachments="False"

 

Field definition:

<Field ID="{67df98f4-9dec-48ff-a553-29bece9c5bf4}"

ColName="tp_HasAttachment"

RowOrdinal="0"

Type="Attachments"

Name="Attachments"

FromBaseType="TRUE" />

 

and view:

<ViewFields>

<FieldRef Name="ID"/>

<FieldRef Name="Attachments"/>