SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For Example: this is the custom field definition in Element .xml file.

<Field ID="{5744d18c-305e-4632-8bd1-09d134f4830d}" 
    Type="Note" 
    Name="PatientName" 
    DisplayName="Patient Name" 
    Group="A Custom Group">
</Field>

My concern is: how can I generate a new FieldID if I need to provision a new field? Also how can I get the FieldRef reference to be used in a Content Type definition?

share|improve this question

You can always generate new GUIDs using Online GUID generator or using Visual Studio

This is how you can provision your field and use it in a Content Type using FieldId and FieldRef. Follow the sample elements.xml below:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<Field ID="{5744d18c-305e-4632-8bd1-09d134f4830d}" 
    Type="Note" 
    Name="PatientName" 
    DisplayName="Patient Name" 
    Group="A Custom Group">
</Field>

<ContentType ID="0x0101000728167cd9c94899925ba69c4af6743e"
               Name="Financial Document"
               Group="Financial Content Types"
               Description="Base financial content type"
               Version="0">
    <FieldRefs>
      <!--  Built-in Title field -->
      <FieldRef ID="{5744d18c-305e-4632-8bd1-09d134f4830d}" Name="PatientName" DisplayName="Patient Name" Required="TRUE" Sealed="TRUE"/>
    </FieldRefs>
</ContentType>



</Elements>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.