1

I know how to create lists with Visual Studio.

I need hint on how to create the custom list named 'test' with Title, URL and an boolean field only on the RootWebs of every site collection the feature is deployed and activated on.

1 Answer 1

2

Add the RootWebOnly="true" property to your custom list. The Feature with the Custom List must be scoped to Site.

<ListInstance Title="My custom list"
            FeatureId="00BFEA71-DE22-43B2-A848-C05709900100"
            TemplateType="100"
            Id="MyCustomList"
            Description="Simple custom list sample."
            Url="Lists/MyCustomList"
            OnQuickLaunch="true"
            RootWebOnly="true" />
18
  • Should I scope this feature to web or site collection level?
    – variable
    Apr 8, 2014 at 6:40
  • By default I can see that it is scoped at web level. Why site ? can you tell me.
    – variable
    Apr 8, 2014 at 6:41
  • Here's a link that explains the different scopes: sharepoint.stackexchange.com/questions/27436/… Apr 8, 2014 at 6:43
  • Can you also tell me whether the above code needs (ROOTWEBONLY) to go in the elements.xml file of the list or the list instance?
    – variable
    Apr 8, 2014 at 6:45
  • 1
    I guess then it will no longer be customizable. Anyways I did the change on the listnameinstance->elements.xml and it worked.
    – variable
    Apr 8, 2014 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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