views:

24

answers:

1

I made a feature that creates a list with some default data (with a list definition and all required XML) I observed that when the list already exists, the data will be inserted again in the list... So I tried to make a "FeatureReceiver" to prevent the feature from creating the list if it already exists, but the base class of FeatureReceiver is an abstract class, so even if the list doesn't exists, I can't "call" the base function to continue the normal process...

Is there an easy way to do this or will I have to create the list through the FeatureReceiver by calling the XML file?

+4  A: 

I would suggest that you create the lists and all the other stuff you have to do (add/remove fields, contenttypes etc) all through code. I usually never create any lists through xml. This might give you some guidance: http://johanleino.wordpress.com/2009/08/12/howto-add-splist-based-on-a-custom-template/

Johan Leino
+1 to this - total control over your lists, especially in upgrade scenarios.
Greg Hurlman