Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

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.