Wednesday, 6 November 2013

Creating Site Columns Programmatically through Elements.xml using all Datatypes

Share it Please
 <Field
       ID="{490f380c-ee51-41e1-8d7d-79aab5ca1d53}"
       Name="Clinic - Patient Name"
       DisplayName="Patient Name"
       Type="Text"
       Required="FALSE"
       Group="Clinic Site Columns">
  </Field>  <!--DataTypes = SingleLineText-->

  <Field
     ID="{FAD4C40B-A5B6-45A1-9C3D-D3494ABCA658}"
     Name="Clinic - Patient ID"
     DisplayName="Patient ID"
     Type="Number"
     Required="TRUE"
     Group="Clinic Site Columns">
  </Field>  <!--DataTypes = Integer-->

  <Field
     ID="{9A526521-3F1B-4AA9-B1E4-6F93C27A76F8}"
     Name="Clinic - Doctor Name"
     DisplayName="Doctor Name"
     Type="Text"
     Required="FALSE"
     Group="Clinic Site Columns">
  </Field>

  <Field
    ID="{02B25AC1-EBAA-464A-B543-829A033ADC58}"
    Name="Clinic - Doctor Address"
    DisplayName="Doctor Address"
    Type="Note"
    Required="FALSE"
    Group="Clinic Site Columns">
  </Field>      <!--DataTypes = Multiline-->

  <Field ID="{943E7530-5E2B-4C02-8259-CCD93A9ECB18}"
       Name="DoctorType"
       DisplayName="DoctorType"
       Type="Choice"
       Required="FALSE"
       Group="Clinic Site Columns" Format="Dropdown">
    <CHOICES>
      <CHOICE>Audiologists</CHOICE>
      <CHOICE>Allergist</CHOICE>
      <CHOICE>Andrologists</CHOICE>
      <CHOICE>Cardiologist</CHOICE>
      <CHOICE>Dentist</CHOICE>
      <CHOICE>Dermatologists</CHOICE>
    </CHOICES>
  </Field>     <!--ChoiceFormat = Dropdown-->

  <Field ID="{07BFA6D1-8730-4EAD-AEAD-428F0D924A12}"
       Name="DoctorTypeByRadioButton"
       DisplayName="DoctorTypeByRadioButton"
       Type="Choice"
       Required="FALSE"
       Group="Clinic Site Columns" Format="RadioButtons">
    <CHOICES>
      <CHOICE>Audiologists</CHOICE>
      <CHOICE>Allergist</CHOICE>
      <CHOICE>Andrologists</CHOICE>
      <CHOICE>Cardiologist</CHOICE>
      <CHOICE>Dentist</CHOICE>
      <CHOICE>Dermatologists</CHOICE>
    </CHOICES>
  </Field>
  <!--ChoiceFormat = RadioButton-->

  <Field ID="{1511BF28-A787-4061-B2E1-71F64CC93FD5}"
         Name="DateOpened"
         DisplayName="Date Opened"
         Type="DateTime"
         Format="DateOnly"
         Required="FALSE"
         Group="Clinic Site Columns">
    <Default>[today]</Default>
  </Field>    <!--DataTypes = DateTime-->

  <Field ID="{060E50AC-E9C1-4D3C-B1F9-DE0BCAC300F6}"
        Name="Amount"
        DisplayName="Amount"
        Type="Currency"
        Decimals="2"
        Min="0"
        Required="FALSE"
        Group="Clinic Site Columns" />

  <!--Rich Text HTML-->

  <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="Clinic Site Columns" />

  <!--HyperLink & Image-->
  <Field ID="{635a2031-2088-4413-b54e-d2af5daf08bf}"
   StaticName="ImageAuthor"
   Name="ImageAuthor"
   DisplayName="Image_Author"
   Description="Author Image" Type="URL" Format="Image" Group="Clinic Site Columns" />

  <!--YES/No Boolean-->
  <Field ID="{11018312-58f9-4eb0-867d-71298f82d98d}" Name="isActive" StaticName="isActive" DisplayName="isActive" Description="Select if Item is Active" Group="Clinic Site Columns" Type="Boolean">
    <Default>0</Default>
  </Field>

No comments:

Post a Comment

Followers

Follow The Author