Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to edit the form that appears when I edit one of my tasks in SharePoint 2010. I currently have a Workflow with an approval process. I believe I can get to the relevent form for my Workflow task (Workflow > Open task list > Forms > EditForm.aspx) however I am unable to edit the form. Am I looking in the right place, or going about this in the correct manner?

share|improve this question

4 Answers 4

This is a bit tricky. You can edit the View page for a task pretty easily (that is the first one that comes up when you click on a task list). When you open it, you see some generic labels and text boxes. The page is actually built from an enumeration at run time. You can use the Insert ribbon at the top to drop your own Data View Web Part under the generic form (then hide the generic form rather than deleting it). Once you've added the DVWP, you can use the Add/Remove Columns button at the top to display the columns that you want. Note: In the Advanced Settings of the list settings for the task list, you can disable the task list from opening up its forms in a dialog. Full screen seems to work better with the task lists as they have a lot of data on them.

Now the tricky part. When you hit the edit button on the display form, it actually takes you to another form (an approval form) in the workflow folder. You can get to that form from the workflows section in SharePoint Designer, but SharePoint Designer isn't fond of you modifying it. I'm not sure if you needed to modify that one also or not. If so, approach it cautiously.

I'd make a backup copy of any of the forms before you modify them.

share|improve this answer

I believe that the EditForm.aspx you are referring to (Workflow > Open task list > Forms > EditForm.aspx) is for the standard tasks in the task list. Workflow tasks, though they are in the same list, operate a little differently.

Firstly, what type of workflow is it?

  1. Browser
  2. SharePoint Designer
  3. Visual studio

Workflow tasks created by the approval workflow, are based on the approval task content type. This content type has a different edit form, normally:

_layouts/WrkTaskIP.aspx?List={List}&ID={Item}&ContentTypeId={ContentType}

What type of change do you want to make to the form?

If you want to add an extra web part outside the form, then you will have to copy the WrkTaskIP.aspx page, and make your own custom one. Then set the EditFormUrl on the approval task content type to be your custom page. Beware all approval tasks in the site collection will get this new form.

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontenttype.editformurl.aspx

If you want to add some extra data display fields to the actual form, then you have to open the workflow in sharepoint designer. When you select the workflow, you should see a Forms box on the summary page. Use InfoPath to edit, save and publish the form, and republish the workflow.

If you want to add some extra data capture fields, then you may have to add them to the content type.

Worst case, you will have to build a custom workflow with a custom approval task content type in visual studio. (I have done this, and the amount of effort was not worth it in my opinion, when upgrading that particular component to sp2010 i drop the customization and handled it another way)

share|improve this answer
    
I found many insightful and new things on your reply. Is it possible to put extra field in to SharePoint Workflow Content Type? so i can collect the data from user while approve or reject with out creating new ASPX form ? SP.Murugesa Pandian., –  user4838 Sep 16 '11 at 9:16
    
This is Great.. How can i hide the delete button displayed in this edit page. Any help is highly appreciated –  sandy_9866141457 Oct 28 '13 at 13:20

This article describes doing it "the advanced way" in Visual Studio, which gives most control: http://www.codeproject.com/Articles/195348/SharePoint-2010-State-Machine-Workflows-with-Custo

It is not 100% intuitive, but right elements are there.

share|improve this answer

Here is my code to customize the Task form: Set the DisplayFormUrl to my application page. (You have to use visual studio however)

var taskList = Web.Lists["Tasks"];
var wfContentType = taskList.ContentTypes["Workflow Task"];
wfContentType.DisplayFormUrl = "_Layouts/MyFeature/MyWorkflowTaskForm.aspx";
wfContentType.EditFormUrl = wfContentType.DisplayFormUrl;
wfContentType.Update();
taskList.NavigateForFormsPages = false;
taskList.Update();
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.