Create List Definition Programmatically using Feature Receiver

I am using a Feature Receiver to create a custom content type in the FeatureActivated event.  I know know to create a list instance through code to use my content type.
What I would like to do is create a custom list definition (list template) to use my custom content type in the FeatureActiviated event.  I would like to do this entirely through C# code only (no xml files). I have been unable to find
any examples of creating a list definition through code on MSDN.

I hope below sample will be helpful for you to create a custom list and fields using code.
In below code block, I have used different field types which include Text , Date, Boolean, choice & lookup filed.
public override void FeatureActivated(SPFeatureReceiverProperties properties)
SPSecurity.RunWithElevatedPrivileges(delegate()
SPSite site = new SPSite(SPContext.Current.Site.ID);
SPWeb web = site.OpenWeb(SPContext.Current.Web.ID);
SPList listExistCheck = web.Lists.TryGetList("My List");
SPList customList;
if (listExistCheck == null)
// Create list and record returned guid
Guid customPagesListGuid = web.Lists.Add("My List",
"My List", SPListTemplateType.GenericList);
//Get list from stored guid
customList = web.Lists[customPagesListGuid];
// Set list properties and add required content types
customList.Title = "My List";
customList.OnQuickLaunch = true; // Set to true to display on the quick launch
customList.ContentTypesEnabled = true;
customList.EnableFolderCreation = true;
customList.EnableSyndication = false; // Turn off rss
customList.Update();
customList.Fields.Add("First Name", SPFieldType.Text, true);
customList.Fields.Add("Last Name", SPFieldType.Text, true);
customList.Fields.Add("Company Name", SPFieldType.Text, false);
customList.Fields.Add("Contact Number", SPFieldType.Text, true);
customList.Fields.Add("Email", SPFieldType.Text, false);
customList.Fields.Add("Post Code", SPFieldType.Text, true);
customList.Fields.Add("Interest", SPFieldType.Choice, false);
//For adding lookup coumn
SPList targetList = web.Lists.TryGetList("Pages");
if (targetList != null)
customList.Fields.AddLookup("News", targetList.ID, false);
SPFieldLookup lookup = (SPFieldLookup)customList.Fields["News"];
lookup.LookupField = targetList.Fields["Title"].InternalName;
lookup.AllowMultipleValues = false; lookup.Update();
//for using choice field
SPFieldChoice fieldStatus = (SPFieldChoice)customList.Fields.GetFieldByInternalName("Interest");
string[] activityTypes = { "Interest 1", "Interest 2" };
fieldStatus.Choices.AddRange(activityTypes);
fieldStatus.DefaultValue = "Interest 1";
fieldStatus.Update();
//using multiline field
customList.Fields.Add("Response", SPFieldType.Note, true);
web.AllowUnsafeUpdates = true;
customList.Update();
//adding fields to default view
SPView dView = customList.DefaultView;
dView.ViewFields.Add("News");
dView.ViewFields.Add("First Name");
dView.ViewFields.Add("Last Name");
dView.ViewFields.Add("Company Name");
dView.ViewFields.Add("Contact Number");
dView.ViewFields.Add("Email");
dView.ViewFields.Add("Interest");
dView.ViewFields.Add("Response");
dView.Update();
customList.Update();
web.Update();
Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer :)

Similar Messages

  • Can External Definition be used or Receiver File content conversion (CSV)?

    Hi Experts,
    I'm a newbie to SAP PI and I started working on file to File(FCC) scenario in which I am provided with the receiver structure as an External definition. The structure is like
    Name
    Place
    Designation
    Salary
    hike
    Can I use the same structure (External Definition) for the receiver file content conversion or do I need to create another specific structure?
    Can I convert the target CSV file to UTF-8 encoding?
    Please help.
    Regards,
    Taro

    Hi,
    Can the above specified structure be used for receiver FCC? Does this work? Can this be converted to UTF-8?
    If it can be used, how do we specify the parameters for FCC then as there's no root element?
    Regards,
    Taro

  • Create ADF elements programmatically using Java

    Hello,
    I use JDeveloper 11.1.1.2.0 and Java 6 (of course)
    <f:view>
    <af:document title="Some Text" id="d1">
    <af:messages id="m1"/>
    <af:form id="f1">
    <af:panelGroupLayout layout="vertical" id="pgl1" halign="center">
    <af:outputText value="Song" id="ot1"/>
    <af:media source="/midi/song.midi"
    standbyText="Song sample" player="quicktime" id="m2"
    contentType="audio/x-midi"/>
    </af:panelGroupLayout>
    </af:form>
    </af:document>
    </f:view>
    I would like to create this construct programmatically. The reason is that I would like to create not only one <af:media> tag but more. But for some reasons it's not a fixed portion of songs I could anticipate. Therefore I want to take the construct above as a template and add more <af:media> tags I need at the moment I realize how many songs I want to play.
    I would like to call this construct from a command button or link on another side to open a new window in which the user could choose among different songs to play.
    Do I have to use DOM or XPath to setup this or is ADF able to offer some support ?
    Best regards
    Martin
    Edited by: user463656 on 05.05.2010 01:41

    Should be something like:
    <f:view>
    <af:document title="Some Text" id="d1">
    <af:messages id="m1"/>
    <af:form id="f1">
    <af:panelGroupLayout layout="vertical" id="pgl1" halign="center"  binding="#{ManagedBean.panelGroup}">
    <af:outputText value="Song" id="ot1"/>
    </af:panelGroupLayout>
    </af:form>
    </af:document>
    </f:view>And somewhere in the MagaedBean methods:
    public class ManagedBean{
    RichMedia rm;
    while .. {
    rm = new RichMedia();
    rm.setstandbyText(....);
    rm.setSource(....);
    panelGroup.getChildren().add(rm);
    }And then refresh the panelgroup with partialTrigger ot partialTarget.
    Edited by: Valhery on 2010-5-5 2:04

  • Creating Result Type Programmatically using C#

    Hi,
    I had created a custom display template and have uploaded on feature activation. now i need to automate the creating of result type.
    Due to less documentation with respective to result type creation using C# i am posting in forum. i had referred the below url.
    http://dev.net.ua/blogs/ivanbilokon/archive/2012/11/22/11389.aspx
    But when i execute the code no error. the new result type is not getting added.
    I expected a result as shown below screen
    Please help me. Thanks in Advance.

    Hello Ram, please check the below link http://nelsonlamprecht.wordpress.com/2013/12/27/sharepoint-2013-search-result-types/
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Small List of Very Useful Features

    I'd like Acrobat to not bounce in the Dock for no reason.
    I'd like to be able to paste text into sticky notes and have the pasted text remain after clicking outside of the sticky note.
    I'd like to be able to move, for example, page 2 (of 6) to the page 4 position and not have some random other page move to some random other position instead.
    I'd like to be able to click on the Acrobat icon in the Dock and have Acrobat display, become the frontmost app, and be responsive to input.
    I'd like to be able to right-click on a thumbnail and have the context menu show up under the mouse click rather than in the lower left corner.

    afraid you preaching to the choir, instead of the congregation.! ;)
    you need to go to adobes website and post the wish list ton their "Feedback" page.
    Now whether they give it a glance or not. Your own your own. ;)
    They already know about the bouncing Dock. have almost from the day Acrobat 8 hit the airwaves.
    So far its just a nuisance not worth the effort to fix. As for the the other they sound like they need addressing.

  • List definition custom type ID or SharePoint base type ID ?

    I have successfully created list definitions using a custom type value in the elements.xml as well as by leaving the type value at the Visual Studio default of 101 (for a custom document library).
    Leaving the type value as 101 seems to work as long as the definition is in a feature on its own (so that the type is unique within that feature).
    I have found articles that suggest that all list definitions should be given a unique type value (conventionally above 10000) and other articles that seem to suggest using the SharePoint built-in list types is valid.
    Is the choice of type based upon whether I need to be able to differentiate my lists in the future or are there other technical reasons for preferring one method over the other ?
    Thank you in advance for your advice as I hope it will prevent me choosing a wrong strategy (or picking up bad habits).

    Greetings,
    what I have done so far is :
    1. Create site columns declaratively and deploy in a feature.
    2. Create content types declaratively and deploy in a feature including a custom feature receiver to prime the content type (which if I understood correctly should propagate changes to the content types to lists).
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Parent ContentType: Document (0x0101) -->
    <ContentType ID="0x010100D0DBA4954E79485287BB9FDD2FD32BD3" Name="KGEngBasicDoc" Group="KG" Description="Default KG Engagament Document" Overwrite="TRUE" Inherits="TRUE" Version="0">
    <FieldRefs>
    <FieldRef ID="{c788a2de-9005-4fbf-a80f-ff570e9e8ebb}" DisplayName="KG Correspondent" Required="FALSE" Name="KGCorrespondent" />
    <FieldRef ID="{4F24D5B8-436C-4A5F-AA1F-B3E66E72576B}" DisplayName="KGCorrespondent_0" Required="FALSE" Hidden="TRUE" Name="KGCorrespondentTaxHTField0" />
    <FieldRef ID="{9e3713d9-3004-4b53-9999-3fc1dbabf88e}" DisplayName="KGDocType" Required="FALSE" Name="KGDocType" />
    <FieldRef ID="{b471df76-40df-463b-9881-bc438cd3d7f3}" DisplayName="KGDocType_0" Required="FALSE" Hidden="TRUE" Name="KGDocTypeTaxHTField0" />
    <FieldRef ID="{ecc70efc-db96-407e-b9fd-d64a3c3a3345}" DisplayName="KGRecipient" Required="FALSE" Name="KGRecipient" />
    <FieldRef ID="{b2170479-32ec-42ee-b12e-3f10c5357c82}" DisplayName="KGRecipient_0" Required="FALSE" Hidden="TRUE" Name="KGRecipientTaxHTField0" />
    <FieldRef ID="{8aa58e8e-38e0-4b04-bcf8-d0c8000e5b36}" DisplayName="KGTasksAndMatters" Required="FALSE" Name="KGTasksAndMatters" />
    <FieldRef ID="{e40d1dd3-731d-4641-9e1e-2eef51f9889b}" DisplayName="KGTasksAndMatters_0" Required="FALSE" Hidden="TRUE" Name="KGTasksAndMattersTaxHTField0" />
    <FieldRef ID="{6150e127-ea5a-4f92-b1f9-b3b966fd67a5}" DisplayName="KGEngagementID" Required="FALSE" Name="KGEngagementID" />
    <FieldRef ID="{983c6a7b-7545-4163-bc05-3afd1b380ad5}" DisplayName="KGEngagementID_0" Required="FALSE" Hidden="TRUE" Name="KGEngagementIDTaxHTField0" />
    <FieldRef ID="{f3b0adf9-c1a2-4b02-920d-943fba4b3611}" DisplayName="Taxonomy Catch All Column" Required="FALSE" Hidden="TRUE" Name="TaxCatchAll" Sealed="TRUE" Sortable="FALSE" />
    <FieldRef ID="{8f6b6dd8-9357-4019-8172-966fcd502ed2}" DisplayName="Taxonomy Catch All Column1" Required="FALSE" Hidden="TRUE" Name="TaxCatchAllLabel" ReadOnly="TRUE" Sealed="TRUE" Sortable="FALSE" />
    </FieldRefs>
    </ContentType>
    </Elements>
    3. Create list definition declaratively, each in their own feature. (Since I wanted to be able to deploy views as well as allowing users to select lists of my custom 'type' to create adhoc, I thought I needed to create list definitions.)
    Note : This is the bit my question was referring to and currently I am using type id 101 instead of the custom type 100042 as I wanted them to be detected as document libraries by various third party
    products.
    ELEMENTS.XML
    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List project item, an error will occur when the project is run. -->
    <ListTemplate
    Name="KGEngagementLibrary"
    Type="101"
    BaseType="1"
    OnQuickLaunch="TRUE"
    SecurityBits="11"
    Sequence="110"
    DisplayName="KGEngagementLibrary"
    Description="KG Engagement Documents"
    Image="/_layouts/15/images/itdl.png"
    DocumentTemplate="121"/>
    </Elements>
    SCHEMA.XML
    <?xml version="1.0" encoding="utf-8"?>
    <List xmlns:ows="Microsoft SharePoint" Title="KGEngagementLibrary" Direction="$Resources:Direction;" Url="KGEngagementLibrary" BaseType="1" xmlns="http://schemas.microsoft.com/sharepoint/" EnableContentTypes="TRUE">
    <MetaData>
    <ContentTypes>
    <ContentType ID="0x010100D0DBA4954E79485287BB9FDD2FD32BD3" Name="KGEngBasicDoc" Group="KG" Description="Default KG Engagament Document" Inherits="TRUE" Version="0"><FieldRefs><FieldRef ID="{c788a2de-9005-4fbf-a80f-ff570e9e8ebb}" DisplayName="KG Correspondent" Required="FALSE" Name="KGCorrespondent" /><FieldRef ID="{4F24D5B8-436C-4A5F-AA1F-B3E66E72576B}" DisplayName="KGCorrespondent_0" Required="FALSE" Hidden="TRUE" Name="KGCorrespondentTaxHTField0" /><FieldRef ID="{9e3713d9-3004-4b53-9999-3fc1dbabf88e}" DisplayName="KGDocType" Required="FALSE" Name="KGDocType" /><FieldRef ID="{b471df76-40df-463b-9881-bc438cd3d7f3}" DisplayName="KGDocType_0" Required="FALSE" Hidden="TRUE" Name="KGDocTypeTaxHTField0" /><FieldRef ID="{ecc70efc-db96-407e-b9fd-d64a3c3a3345}" DisplayName="KGRecipient" Required="FALSE" Name="KGRecipient" /><FieldRef ID="{b2170479-32ec-42ee-b12e-3f10c5357c82}" DisplayName="KGRecipient_0" Required="FALSE" Hidden="TRUE" Name="KGRecipientTaxHTField0" /><FieldRef ID="{8aa58e8e-38e0-4b04-bcf8-d0c8000e5b36}" DisplayName="KGTasksAndMatters" Required="FALSE" Name="KGTasksAndMatters" /><FieldRef ID="{e40d1dd3-731d-4641-9e1e-2eef51f9889b}" DisplayName="KGTasksAndMatters_0" Required="FALSE" Hidden="TRUE" Name="KGTasksAndMattersTaxHTField0" /><FieldRef ID="{6150e127-ea5a-4f92-b1f9-b3b966fd67a5}" DisplayName="KGEngagementID" Required="FALSE" Name="KGEngagementID" /><FieldRef ID="{983c6a7b-7545-4163-bc05-3afd1b380ad5}" DisplayName="KGEngagementID_0" Required="FALSE" Hidden="TRUE" Name="KGEngagementIDTaxHTField0" /><FieldRef ID="{f3b0adf9-c1a2-4b02-920d-943fba4b3611}" DisplayName="Taxonomy Catch All Column" Required="FALSE" Hidden="TRUE" Name="TaxCatchAll" Sealed="TRUE" Sortable="FALSE" /><FieldRef ID="{8f6b6dd8-9357-4019-8172-966fcd502ed2}" DisplayName="Taxonomy Catch All Column1" Required="FALSE" Hidden="TRUE" Name="TaxCatchAllLabel" ReadOnly="TRUE" Sealed="TRUE" Sortable="FALSE" /></FieldRefs></ContentType><ContentTypeRef ID="0x0101">
    <Folder TargetName="Forms/Document" />
    </ContentTypeRef><ContentTypeRef ID="0x0120" /></ContentTypes>
    ETC..
    4. Deploy list instances programmatically using event receiver.
    Note : The highlighted bits relate to the type and feature id used in my content type deployment.
    public override void FeatureActivated(SPFeatureReceiverProperties properties)
    SPWeb web = properties.Feature.Parent as SPWeb;
    try
    SPList list = null;
    list = null;
    foreach (SPList _list in web.Lists)
    if (_list.Title.Equals("Administration"))
    list = _list;
    if (list == null)
    web.AllowUnsafeUpdates = true;
    Guid listID = web.Lists.Add("Administration", //List Title
    "Administration documents", //List Description
    "Lists/Administration", //List Url
    "8ba84f44-fe8c-4789-a7dc-d264154041d2", //Feature Id of List definition Provisioning Feature – CustomList Feature Id
    101, //List Template Type
    "101"); //Document Template Type .. 100 is for None
    web.Update();
    web.AllowUnsafeUpdates = false;
    catch (Exception ex)
    The whole point of trying to create list definitions was that this seemed to be the only way for me to provide customized views for users at list creation time.  If it wasn't for that then I think I could have created all of
    these elements programmatically instead.
    (I could not figure out how to create a list definition programmatically).
    Please let me know what I should or shouldn't be doing in this deployment chain.
    Thanks !!

  • [Forum FAQ] A custom filterable list definition

    Scenario:
    A list can be filtered by query string from URL, now we need to create a custom list definition contains this feature.
    Solution:
    Here are the steps in details:
    1. Create a List Definition project in Visual Studio 2010;
    2. Modify the Schema.xml file in the list definition project as below:
    3. Build and deploy the solution to SharePoint 2010 server;
    4. Here are the screenshots about how it works:
    Filter the list with such an URL:
    http://sp/Lists/List1/AllItems.aspx?Param1=2014-08-24&Param2=2014-08-28
    References:
    Creating SharePoint 2010 List Definitions in Visual Studio 2010
    SharePoint 2010 - Create List Definition and Instance
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    A good solution. Liked it very much. Can you please make it a technet blog for others.
    [email protected]

  • Creating JAR files programmatically

    I am trying to create JAR files programmatically using the java.util.zip and java.util.jar APIs. I am starting with just a set of directories containing .class files. I can seem to make the JAR but if I try to use any of the classes in it they don't work. But, if I unzip the JAR using WinZip, the classes are usable. So I am somehow building the JAR file incorrectly. Does anyone have any ideas or suggestions? The code is pretty long so I won't post it yet but I can send it to you if you'd like to see it. Contact by email if you'd like to see the code. Thanks.

    What paths are you encoding? Here are a couple of rules:
    1 - All paths are '/' separated, and do not begin with a '/'.
    2 - All paths are relative (see 1) and contain the exact package name of the class, plus the class.
    E.G., the class java.lang.Object would look like this in your jar:
    java/lang/Object.classNothing more or less.

  • How to add Services programmatically using BAPI_BUS2002_ACTELEM_CREATE_M

    Hi :
    I need to create a project programmatically using the standard PS BAPI. My problem is that I don't know how to add external activities ( Services ) into my project.  I have all steps, except this one. I think that the BAPI BAPI_BUS2002_ACTELEM_CREATE_M should do it but I cannot find where to put the Service Number, Text and Quantity.
    Thanks a lot in advance.
    Jose J. Quezada.

    The problem remains the same. The BAPI_NETWORK_MAINTAIN does not have the fields to add the Services. It can adds an External Activity. The services are External Activities but where are the fields. I need an example or a more specific response. I know how to add a Material for example, but the Services are quite different.
    Kind Regards,
    Jose.

  • Create Check Box Programmatically

    Hi ALL
    Let me know how to Create Check Box Programmatically using table column.
    Thanking You
    Rehards
    Lakmal

    You can't create Forms widgets dynamically. What you have to do is create them at design time and then hide/unhide them at runtime using things like stacked canvases.
    Regards
    Grant Ronald

  • How to create visitor roles programmatically

    Could you please help me how to create visitor roles programmatically using weblogic portal.
    Thanks in advance

    Hi,
    Point this method to the selectItems under selectonechoice.
            if (yourList == null) {
                (yourList = new ArrayList();
                DCBindingContainer bindings = ADFUtil.getDCBindingContainer();
                DCIteratorBinding iteratorbinding =
                    bindings.findIteratorBinding("yourVO1Iterator");
                if (iteratorbinding != null) {
                    Row[] rows = iteratorbinding.getAllRowsInRange();
                    String value = null;
                    Long key = 0L;
                    for (Row row : rows) {
                        value = (String)row.getAttribute("Attrib0");
                        key = (Long)row.getAttribute("Attrib1");
                        yourList .add(new SelectItem(key.toString(), value));
            return yourList;
    Thanks
    Nitish

  • Can I add Custom Content Type created programmatically to Custom List Definition?

    I have created Custom content type programmatically in the Feature Receiver. Followed by this have another feature which creates List Template. I want to add the custom content type to the list template.
    Using VS 2012, I added the custom content type to the list definition. The Schema.xml for the list definition looks as below:
    <ContentTypes>
    <ContentTypeRef ID="0x010100D7D9F4B1F4A9684BB44389571024B2EC00C393BB21B8AD7B41B62A87DF0501504D" />
    </ContentTypes>
    ID was automatically added by the VS tool.
    List Template is created, the new content Type is also added, but the Name is displayed as "Document" instead of the custom content type name. So I see two CTs with the name "Document".
    How can I achieve this? Any help is appreciated.

    Hi,
    Please add EnableContentTypes="TRUE" in the <List > tag.
    The following materials would be helpful:
    How to add custom content type to a custom list
    http://innersharepoint.blogspot.de/2009/10/how-to-add-custom-content-type-to.html
    SharePoint Custom List Definition with Content Type
    https://achrafsp.wordpress.com/2013/03/31/sharepoint-list-definition-with-content-type/
    Create a Custom SharePoint List Definition
    http://www.mssharepointtips.com/tip.asp?id=1188
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Visual Studio 2013 is creating new feature every time new list definition is added

    We are using Visual Studio 2013 and details are as under:
    Microsoft Visual Studio Ultimate 2013
    Version 12.0.30501.00 Update 2
    We we add a new list definition in our project, it creates a new feature with it. If we delete the feature and add list definition in the existing feature, list is created but columns are not added in the list.
    Same thing happened if we rename "Feature1", a new feature is created every time a new list definition is created.
    This doesn't happen when we add a Visual WebPart.
    Also, we have three different custom list option in the drop down in new list creating wizard.
    Is this a bug or we are doing something different.   
    http://farhanfaiz.wordpress.com

    Intellisense has a bug in VS2013 where it doesn't recognize InitializeComponent when you start working on the XAML.  My feeling is that if you try to compile this app, it will run fine (as long as there are no actual errors).
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Application Error while activating the feature - for creating list content type, list definition and list instance

    Dear all,
    I am getting application error while enabling the feature. if any body can point out the issue - that will be helpful.
    content type
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Field ID="{4C1B0A21-FCE0-4CFE-8742-A250672AFE4F}" Type="Note" Name="CourseDesc" DisplayName="Course Description" Required="TRUE" Group="Training Site Columns"/>
    <!-- Parent ContentType: Item (0x01) -->
    <ContentType ID="0x0100d57ecc53fde34177b096abd0ec90a8f9"
    Name="TrainingCourses"
    Group="Training Content Types"
    Description="Defines a Course"
    Inherits="TRUE"
    Version="0">
    <FieldRefs>
    <FieldRef ID="{4C1B0A21-FCE0-4CFE-8742-A250672AFE4F}" Name="CourseDesc" DisplayName="Course Description" Required="TRUE"/>
    </FieldRefs>
    </ContentType>
    </Elements>
    List definition
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List Definition project item, an error will occur when the project is run. -->
    <ListTemplate
    Name="TrainingCourses"
    Type="10100"
    BaseType="0"
    OnQuickLaunch="TRUE"
    SecurityBits="11"
    Sequence="410"
    DisplayName="TrainingCourses"
    Description="Training Courses List Definition"
    Image="/_layouts/images/itgen.png"/>
    </Elements>
    List instance
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <ListInstance Title="TrainingCourses"
    OnQuickLaunch="TRUE"
    TemplateType="10100"
    Url="Lists/TrainingCourses"
    Description="Training Course List Instance">
    </ListInstance>
    </Elements>
    schema
    <?xml version="1.0" encoding="utf-8"?>
    <List xmlns:ows="Microsoft SharePoint" Title="TrainingCourses" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/TrainingCourses-LD_TrainingCourses" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
    <MetaData>
    <ContentTypes>
    <ContentType ID="0x0100d57ecc53fde34177b096abd0ec90a8f9" Name="TrainingCourses" Group="Training Content Types" Description="Defines a Course" Inherits="TRUE" Version="0">
    <FieldRefs>
    <FieldRef ID="{4C1B0A21-FCE0-4CFE-8742-A250672AFE4F}" Name="CourseDesc" DisplayName="Course Description" Required="TRUE" />
    </FieldRefs>
    </ContentType>
    </ContentTypes>
    <Fields>
    <Field ID="{4c1b0a21-fce0-4cfe-8742-a250672afe4f}" Type="Note" Name="CourseDesc" DisplayName="Course Description" Required="TRUE" Group="Training Site Columns" />
    </Fields>
    <Views>
    <View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">30</RowLimit>
    <ViewFields>
    <FieldRef Name="LinkTitleNoMenu">
    </FieldRef>
    <FieldRef Name="CourseDesc">
    </FieldRef>
    </ViewFields>
    <Query>
    <OrderBy>
    <FieldRef Name="Modified" Ascending="FALSE">
    </FieldRef>
    </OrderBy>
    </Query>
    <ParameterBindings>
    <ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
    <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
    <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
    </ParameterBindings>
    </View>
    <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">30</RowLimit>
    <ViewFields>
    <FieldRef Name="Attachments">
    </FieldRef>
    <FieldRef Name="LinkTitle">
    </FieldRef>
    <FieldRef Name="CourseDesc">
    </FieldRef>
    </ViewFields>
    <Query>
    <OrderBy>
    <FieldRef Name="ID">
    </FieldRef>
    </OrderBy>
    </Query>
    <ParameterBindings>
    <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
    <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
    </ParameterBindings>
    </View>
    </Views>
    <Forms>
    <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    </Forms>
    </MetaData>
    </List>
    I am applying the feature to SPWeb level.
    cheers
    Sathya

    redeployed a new solution; since I was getting this error. I would have done typo errors etc.
    https://naveengopisetty.wordpress.com/2011/09/10/error-occurred-in-deployment-step-activate-features-invalid-file-name-the-file-name-you-specified-could-not-be-used-it-may-be-the-name-of-an-existing-file-or-directory-or-you-may-not-have-pe/
    Cheers
    Sathya

  • Creating Calendar List using List definition

    HI,
    How to create a Calendar List based on "List" option in VS 2012 ?
    I have tried the below:
    1) Created custom content type with Events as parent. Added few additional columns
    2) Added a List option, based on default list. Removed the "Item" content type and added the custom content type.
    3) In the List definition and List Instance elements.xml, modified the Type to 106.
    Deployed the solution. The list was created, but it is not a calendar list. What am I missing?
    How to create a Calendar list?
    Thanks

    Hi,
    I had tested with a publishing site using the VS 2012, in the list option, it also contains the calendar based list.
    I didn’t do any other steps, just create an SharePoint 2013-Empty Project, then add new item, select the List option.
    Did you install the Microsoft Office Developer Tools for Visual Studio 2012?
    There are two articles about Prerequisites for creating SharePoint 2013 projects using Visual Studio 2012, you can have a look at them.
    http://blogs.msdn.com/b/timquin/archive/2013/01/22/setting-up-visual-studio-2012-for-sharepoint-2013-development-offline.aspx
    http://blogs.msdn.com/b/how24/archive/2013/03/12/creating-sharepoint-2013-projects-using-visual-studio-2012.aspx
    Thanks,
    Jason
    Jason Guo
    TechNet Community Support

Maybe you are looking for

  • Display Material |Attachment File in ALV report

    Dear All, I have to make ALV report for mutliple material attachment file.I want to display material wise attachment where user can see in report. We can see attachment list in Service For Object button in MM03 tcode for single material. And i also i

  • What is y3.online.sec.update and why/who is this t...

    Hello: What is y3.online.sec.update and why/who is this trying to call me/message me via my skype? Normally if there is an official skype security update/fix it is automatic when I log in so is this some type of phishing scam?   I blocked the contac

  • Increment a Date in JSP Page

    Hi , I am giving a interface to a user where userr can select a start date and end date and on clicking submit ..i have to display all the dates between start date and end date. Now I know i can increment a date by using georgianCalander, But what i

  • Information about acrobat 9.0

    Dear Sirs We have been informed by the TTF company that TTF software has been acquired by Adobe System. As end users of the software Project Reviewer, we would like to understand more details concernig how the whole "package" has been incorporated in

  • Installing forms 6i with Personal Edition

    Is it possible to install formas and eports 6i on a win98 workstation running Personal editon 8.1.6? I want to learn the product but don;t want to purchase unless it will work. Thanks in advance.