Sunday, April 17, 2011

InfoPath Task Edit Form for SharePoint Workflows

When developing custom Task Edit forms for SharePoint workflows, most of the times, first timers will find that the form does not show up on clicking the task link in the Tasks list (or email).

I have been developing a workflow with custom task edit forms using InfoPath 2010 and find that every time the task link is clicked we get the "specified file cannot be found" error. This means that SharePoint is not able to find the ".xsn" file. But that's not the case always, the same error shows up for other reasons too, so it's actually a misleading error message. People spend days trying to arrive at a fix and are left totally clueless by this error message.

Here's a checklist of thing you need to ensure in your workflow project as well as the task edit InfoPath form to get a custom Task Form (InfoPath) working -

1. Create a module for the InfoPath form in your Visual Studio 2010 SP Workflow project and then publish your Task Edit Form into this location -


2. Ensure that the Elements.xml points to the TaskEdit InfoPath .xsn correctly -


  
    
  




3. When publishing the original Task Edit form to the Project module folder, blank out the text box from the second screen of the publishing wizard.































4. Make sure that you have the Workflow Elements.xml looks like the one below and has the correct Task form URN. Your file may differ slightly depending on the number and type of forms.


  
    
    
      List
        urn:schemas-microsoft-com:office:infopath:MyTaskForm:-myXSD-2011-04-12T20-27-46
 _layouts/WrkStat.aspx
    
  



5. Ensure that your Workflow feature looks like this -


  
    
    
  




If the form still does not show up then sign the form, set full trust and publish. And after all the toil, if it still does not work, then check for typos.

No comments:

Post a Comment

Using Recoil with SPFx Try out the latest alternative to Redux with SPFx When developing with Redux or MobX, we have ha...