I've created a ListTemplate based off of a custom content type in Visual Studio for a document library. The content type adds two fields, a fiscal year and a fiscal month. It adds it to the template fine and the user is prompted correctly after uploading a doc for those fields, but the default view that is used when a new list is created from this list template does not include those fields. Is it possible to get those fields added to the default view? Thanks!
1 Answer
If you follow the MSDN article How to: Create a Custom List Definition in the part "Create the List Definition from the Content Type" step 5 and 6 describes how to add fields to the view:
Step 5. Next, open the Schema.xml file that was created.
Step 6. In the ViewFields element, add the same FieldRef element that you added to the content type. The following XML adds a reference to the field.
<FieldRef ID="FieldId" Name="FavoriteColor" />