Have you ever tried to deploy a custom survey as a list definition in SharePoint 2007?
This is what I’ve done:
- Created a survey with my 5 questions in the interface. And then used SPM2007 (see codeplex) to export the list details such as fields, views etc
- Created a list template in Visual Studio (Changed all the bits that I need to change to turn it into a survey
a. Added my question as fields in the schema.xml
b. Gave my list template a unique Type
c. Set Base Type to 4 in my list definition
d. Created a feature to activate the Survey.
My list definition:
Description=“A survey list template“
I got the survey to appear in my site. So far so good.
I tried to respond to my question however the form only contains a Cancel and Save button.
As I’ve got branching on this Survey there should also be a Next button. Where has the Next button gone to?
I tried a couple of different options but I couldn’t get this to work.
Then I decompiled the sharepoint dll looking for the ListFormWebPart code and I noticed that to identify if we’re talking about a Survey or not sometimes the following code is used: (template != SPListTemplateType.Survey)
(this.list.BaseType == SPBaseType.Survey)
The second option isn’t really a problem as BaseType is set to 4 and this is the same as the out of the box Survey. However the first line could be the cause of my problem as my Type is set to 20002.
As the type has to be unique … I wonder if it’s not possible to deploy a survey this way?