Tuesday, July 15, 2008

Changing Workflow Default Forms

Its very easy to change workflow default forms. I mean the association form, Initiation form or the task list form.

Association Form

To change the association form simply open Your workflow Project and open the file name "Workflow.xml".


In Workflow Tag before ending add Association Fomr Url as:

AssociationUrl="_layouts/MyAssocForm.aspx"

In MetaData Tag Under the "Association_FormURN" element add the Form URL.


Initally it will be commented you have to uncomment it.

Instantiation Form

Similarly to change the Instantiation form


In Workflow Tag before ending add Instantiation Fomr Url as:

InstantiationUrl="_layouts/MyInitForm.aspx"

enter Your Form Id in Workflow.xml under MetData Tag in "Instantiation_FormURN"

Don't forget to uncomment it



TaksList Forms

To change task lists form you have to write some extra code other than adding your form Id in Workflow.xml
just write write these lines in Your "OnTaskCreated" Event


private void OnTaskCreated(object sender, EventArgs e)
{
createTask1_TaskProperties1.Title = "Demo Task";
createTask1_TaskProperties1.AssignedTo = @"UserName";
createTask1_TaskProperties1.Description = "This is a demo task";
createTask1_TaskProperties1.TaskType = 0;
}

And that is it. feel free to ask questions if you find any problem.




1 comment:

Amelia said...

I followed the steps the same way you have listed. Thanks a lot for explaining the complete process that is easy to understand and follow.
sharepoint electronic signature