Let's get started, create a SharePoint 2010 Project in the same solution called LookUp.Data, this is going to be where our list definitions and list instances are going to reside.
With your Lookup.Data project Created add two folders:
- List Definitions
- List Instances
Lets create some list definitions:
- Add a new item to the List Definition folder
- In the left pane select SharePoint 2010,
- In the middle pane select List Definition from Content Type
- Give your list definition a descriptive name, and somehow specify that it's a list definition. I added an _LD but you can do whatever you like.
- Click the Add button
- Next you'll see the SharePoint Customization Wizard:
- Make sure to shorten the solution name
- select the content type you want to build the definition from
- uncheck the "Add a list instance for this list definition"
- Now with Both of our List Definitions complete lets go and create some List Instances to match.
- Right click on the List Instance folder and add a new item.
- in the left hand pane again select SharePoint 2010
- In the middle pane pick List Instance
- Give it a descriptive Name like "Department"
- Click Add
- Next you'll see the SharePoint Customization Wizard:
- Give your list instance a display name
- select the List Definition you want to Instantiate
- Fill out a description
- specify the URL address for the list
- and finally decide whether you want it in the quick launch bar, that's really up to you, generally if a list is updated regularly by a user you'd set it to true.
- Rename Feature 1 to "Lookup.Data"
- Double Click the Lookup.Data feature to view the feature manifest.
- Change the Title to something descriptive
- Give it a description
- set the scope
- and most importantly remember to add all the List instances to the manifest.
Once Complete your Feature Manifest should resemble the following.
Now deploy the Lookup.Data project to deploy our list definitions and instances. Now you need to know that when you deploy a project that contains a list instance two shitty things happen:
- all list data is cleared
- the list is assigned a new GUID (that ruins lookup columns)
I mention these because in the next post we're going to add a lookup column and then rewire it.