Tuesday, July 15, 2014

SharePoint Sample Field (Columns) Schemas

SharePoint Fields (Columns) XML is essential for every SharePoint Object Model development.

Multiple User Field

<Field
     ID="{f6377553-35fc-4166-9cc3-88fa32a5d7dd}"
     Name="WFCApprovers"
     DisplayName="WFC Approvers"
     Type="UserMulti"
     Required="FALSE"
     UserSelectionMode="0"
     Group="Custom">
</Field>

UserSelectionMode Options: 0 - PeopleOnly , 1 - PeopleAndGroup



Single User Field





<Field
     ID="{f6377553-35fc-4166-9cc3-88fa32a5d7dd}"
     Name="UserField"
     DisplayName="User Field"
     Type="User"
     Required="FALSE"
     UserSelectionMode="1"
     Group="Custom">
</Field>


Boolean Field





<Field
     ID="{6ed8dbbf-4726-4a63-b358-e4797149a8ba}"
     Name="Booleanfld"
     DisplayName="Boolean Feild"
     Type="Boolean"
     Required="FALSE"
     Group="Custom">
  <Default>1</Default>
</Field>


Text Field





<Field
     ID="{9253731d-2eba-48a1-8172-94e3eae4d266}"
     Name="TextField"
     DisplayName="Text Field"
     Type="Text"
     Required="FALSE"
     Group="Custom">
</Field>


Note Field





<Field
     ID="{9253731d-2eba-48a1-8172-94e3eae4d266}"
     Name="TextField"
     DisplayName="Text Field"
     Type="Note"
     Required="FALSE"
     Group="Custom">
</Field>


Number Field





<Field
     ID="{d0b93b5a-7df2-4aa8-95ce-98c89feefb8b}"
     Name="NumberField"
     DisplayName="NumberField"
     Type="Number"
     Required="FALSE"
     Group="Custom">
</Field>


Choice Field





<Field
     ID="{1af7f723-5eb6-43fc-a399-f6dde4397598}"
     Name="ChoiceField"
     DisplayName="Choice Field"
     Type="Choice"
     Required="FALSE"
     Group="Custom">
  <CHOICES>
    <CHOICE>NEW</CHOICE>
    <CHOICE>OLD</CHOICE>
  </CHOICES>
</Field>


Lookup List





<Field 
       ID="{d98ee21b-158e-49ff-b45e-86fb6df54225}"
       Name ="LookupList"
       DisplayName="Lookup List" 
       Type="Lookup" 
       List="Lists/List1"  
       ShowField="Title"
       Group="Custom" >
</Field>


Multi Lookup List





<Field 
       ID="{d98ee21b-158e-49ff-b45e-86fb6df54225}"
       Name ="LookupList"
       DisplayName="Lookup List" 
       Type="LookupMulti" 
       Mult="True" 
       List="Lists/List1"  
       ShowField="Title"
       Group="Custom" >
</Field>


Date Field





<Field
     ID="{33a66323-6665-434e-98b1-be3d3f692ac3}"
     Name="DateField"
     DisplayName="Date Field"
     Type="DateTime"
     Required="FALSE"
     Group="Custom">
</Field>


Calculated Field





<Field
     ID="{64027cf3-2e86-44df-8ae4-7c3fe56128e3}"
     Name="ConcatTitle"
     DisplayName="Concat Title"
     Type="Calculated"
     ResultType="Text"
     Required="FALSE"
     Group="Custom">
  <Formula>
    =CONCATENATE(PCode,&quot;-&quot;,Title)
  </Formula>
  <FormulaDisplayNames>
    =CONCATENATE([P Code],&quot;-&quot;,Title)
  </FormulaDisplayNames>
  <FieldRefs>
    <FieldRef Name="PCode" />
    <FieldRef Name="Title" />
  </FieldRefs>
</Field>
Post a Comment