Question

I added a new feature and inside FeatureActived wrote following code to open my custom task form whenever user clicks on task title.

SPContentType myTask = web.ContentTypes["Workflow Task"];  
myTask.EditFormUrl = "_layouts/mytask.aspx";  
myTask.DisplayFormUrl = "_layouts/mytask.aspx";  
myTask.Update(true);

This code is working fine. Problem is I want to revert to default out of the box form but even if I comment these lines and re-deploy solution OR disable feature in "site collection features" OR retract solution, clicking on task title still takes the user to my custom form.

How can I revert to default form?

Was it helpful?

Solution

Please try the following PowerShell to reset the values:

Add-PSSnapin microsoft.sharepoint.powershell
$web = Get-SPWeb "http://sharepointurl"
$ct = $web.ContentTypes["Workflow Task"]
$ct.DisplayFormUrl = $null
$ct.EditFormUrl = $null
$ct.Update()
$web.Dispose()
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top