Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Do I create the tasks list in the ONET.xml file?

  Asked By: Cedric    Date: Jan 27    Category: Sharepoint    Views: 2462

We are trying to create a site programmatically with a tasks list and
workflow attached to it. Basically, the tasks list will have an item
called Step One. Once this item is set to complete, then Step Two will
appear in the task list, and so on. I know how to programmatically
create sites, but I have a few unknowns. Do I create the tasks list in
the ONET.xml file, or do I create it in a feature (if so, how do I
programmatically activate it?). How do I associate the workflow to it?

Any step by step guidance would be most helpful.



1 Answer Found

Answer #1    Answered By: Yvonne Rodriquez     Answered On: Jan 27

Like many technologies (CSS comes to mind), you can choose to place your
code in one of multiple locations to achieve the same result. Here, you
can create  the tasks  list instance using a <List> element in either the
ONET or a Feature, your choice.

If you choose the ONET, every site  created from this Site Definition
would contain an instance of the list.

If you choose a Feature, the ONET can still call the Feature but it
could be reused elsewhere. The Feature could also be
activated/deactivated even after you had a multitude of Sites. In fact,
the Feature could be activated in Sites provisioned before the Feature
even existed.

Didn't find what you were looking for? Find more on Do I create the tasks list in the ONET.xml file? Or get search suggestion and latest updates.