Search code examples
c#.netsharepointsharepoint-2010

Sharepoint 2010 add fields to list definition


I have a list definition:

<?xml version="1.0" encoding="utf-8"?>

name of the List Definition project item, an error will occur when the project is run. -->
  <ListTemplate
      Name="LogsList"
      Type="10004"
      BaseType="0"
      OnQuickLaunch="TRUE"
      SecurityBits="11"
      Sequence="410"
      DisplayName="Logs List"
      Description="Log instances for messages"
      Image="/_layouts/images/itgen.png"/>

</Elements>

How can I add a field? I have tried few things but fields are not appearing after the deployment.


Solution

  • You'll have to create Field definitions, create one or more Content Types, add the field definitions to then and add these content types to your list.