Saturday, April 5, 2008

ListInstance FeatureID Error

You may be tempted some day to write a ListInstance feature which will create an instance of a list for a list definition that has already been deployed. In this Post in the section entitled "List Instance Feature" I specifically said take note of the FeatureId in my example but did not explain it.

The documentation on MSDN is not great but it does explain how the FeatureId should be used.

  • The FeatureId must be set to the FeatureId of the list definition Feature. So in my example of a document library it would be 00BFEA71-E717-4E80-AA17-D0C71B360101.
  • If you have a custom list definition, it would be the FeatureId used for the list definition.
  • If you have both the list definition and the list instance defined in the same Feature you do not need to specify the FeatureId.

The error you will get in the logs when trying to activate the ListInstance Feature tells you pretty much nothing.

Also not the TemplateType but be set to the ID that is in the list definition.

No comments: