Search code examples
sharepointworkflowwindows-sharepoint-services

Creating a workflow task generates an "Invalid field name" error


I have a custom (code-based) workflow, deployed in WSS via features in a .wsp file. The workflow is configured with a custom task content type (ie, the Workflow element contains a TaskListContentTypeId attribute). This content type's declaration contains a FormUrls element pointing to a custom task edit page.

When the workflow attempts to create a task, the workflow throws this exception:

Invalid field name. {17ca3a22-fdfe-46eb-99b5-9646baed3f16

This is the ID of the FormURN site column. I thought FormURN is only used for InfoPath forms, not regular aspx forms...

Does anyone have any idea how to solve this, so I can create tasks in my workflow?


Solution

  • It turns out that I was missing two things:

    • My custom content type neeeded to be added to the workflow task list
    • I needed to add an empty FieldRefs element to my content type definition; without it, the content type wasn't inheriting any workflow task fields.