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:
<?xmlversion=“1.0“encoding=“utf-8“ ?>
<Elements xmlns=http://schemas.microsoft.com/sharepoint/>
<ListTemplate Name=“MySurveyTemplate“
Type=“20002“
BaseType=“4“
OnQuickLaunch=“TRUE“
SecurityBits=“11“
Sequence=“410“
DisplayName=“My Survey“
Description=“A survey list template“
Hidden=“FALSE“
Image=“/_layouts/images/itgen.gif“>
</ListTemplate>
</Elements>
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)
and sometimes
(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?
did you managed to solve your problem ? I’m in the same situation
Hi Ronen,
No I haven’t found a good solution for this. Let me know if you find a solution.
Thanks,
Pieter
How to create Survey list using visual studio List template. Is this possible or not. Please let me know.
It isn’t possible with the out of the box create a list template options. Or at least I haven’t found a good way of doing this. You could create a survey list and then programmatically update the list. But that becomes less manageable.