Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7171225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:22:17+00:00 2026-05-28T15:22:17+00:00

When I search for documentation about creating contenttypes using code (C#) I always find

  • 0

When I search for documentation about creating contenttypes using code (C#) I always find examples using a SPFieldLink to link to an existing field of the site and adding this via

contentType.FieldLinks.Add()

But there is also a method to add fields directly. Is there a good reason why I should not simply add fields using

contentType.Fields.Add(SpField())

?!?

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:22:18+00:00Added an answer on May 28, 2026 at 3:22 pm

    It might help to look at the XML for a list.

    Here is the XML for the Announcement Content Type:

    <FieldRefs>
        <FieldRef ID="{7662cd2c-f069-4dba-9e35-082cf976e170}" Name="Body" />
        <FieldRef ID="{6a09e75b-8d17-4698-94a8-371eda1af1ac}" Name="Expires" />
    </FieldRefs>
    

    Here is the XML for the Announcement List:

    <Fields>
      <Field ID="{7662cd2c-f069-4dba-9e35-082cf976e170}" Type="Note" RichText="TRUE" RichTextMode="FullHtml" IsolateStyles="TRUE" NumLines="15" Name="Body" DisplayName="$Resources:core,camlid2;" Sortable="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Body">
      </Field>
      <Field ID="{6a09e75b-8d17-4698-94a8-371eda1af1ac}" Type="DateTime" Name="Expires" DisplayName="$Resources:core,camlid3;" Format="DateOnly" FromBaseType="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Expires">
      </Field>
    </Fields>
    

    Lists have Fields. Content Types have FieldRefs.

    I’m not sure if this is exactly right, but I always describe it as the difference between classes and interfaces or abstract classes. A Content Type is the definition for a list, but, like an interface, it does not contain any data or functionality. Since Fields contain data and functionality, Content Types (disassociated from a list) do not have Fields, they have FieldRefs. YMMV – but that always helps me keep them straight.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Where can I find documentation about WDS, specifically, using SQL queries from C# to
I've read all of the documentation online about building search interfaces and adding custom
Can anyone provide me with a link to good article about using Firebird.NET with
Okay, I'm fairly new to R and I've tried to search the documentation for
Am curently looking at the jqgrid documentation on advanced search and specifically search_adv.php file
Simple question, what is the best way on windows to search the documentation. This
I'm using CodeGear RAD Studio 2009. I want to use the Mutis text search
In the UIViewController documentation about the searchDisplayController property 1 it says: If you create
I am about to implement a geo search on a website. I really don't
First off, I'm not asking about how to generate documentation FROM PHP source. That's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.