1

I have been looking all over the internet for instructions on how to create a content type based off the Workflow Task type. Everything I have found thus far seems like it is incomplete or has gaps that I can't seem to bridge. I am using Visual Studio 2010 and SharePoint 2007. If someone can point me in the right direction I would appreciate it.

Thanks.

2 Answers 2

1

It should be no different than creating content type from any other built in content types. It is little tricky because the Workflow Task Content type is hidden.

Following is the Workflow Task content type from which you need to derive your own content type:

 <ContentType ID="0x01080100C9C9515DE4E24001905074F980F93160"
        Name="$Resources:WorkflowTaskIP_Name;"
        Description="$Resources:WorkflowTaskIP_Description;"
        Group="_Hidden"
        Hidden="TRUE"
        Version="0">
        <FieldRefs>
        </FieldRefs>
        <XmlDocuments>
            <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
                <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
                    <Display>_layouts/WrkTaskIP.aspx</Display>
                    <Edit>_layouts/WrkTaskIP.aspx</Edit>
                </FormUrls>
            </XmlDocument>
        </XmlDocuments>
    </ContentType>

And following is an example of Publishing Approval Workflow Task that derives from above content type and ships with SharePoint:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- ReviewPublishing -->
    <ContentType ID="0x01080100C9C9515DE4E24001905074F980F9316000A245BAB39C6543159300E33084BA0409"
        Name="Publishing Approval Workflow Task (en-US)"
        Description="A work item created by an workflow that you or your team needs to complete."
        Group="_Hidden"
        Hidden="TRUE"
        Version="0">
        <FieldRefs />
        <XmlDocuments>
            <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
                <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
                    <Display>_layouts/WrkTaskIP.aspx</Display>
                    <Edit>_layouts/WrkTaskIP.aspx</Edit>
                </FormUrls>
            </XmlDocument>
            <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v4/workflow/forms">
                <WorkflowForm xmlns="http://schemas.microsoft.com/sharepoint/v4/workflow/forms">~sitecollection/_catalogs/wfpub/Publishing Approval/ReviewPublishing_Task_1033.xsn</WorkflowForm>
            </XmlDocument>
        </XmlDocuments>
    </ContentType>
</Elements>
3
  • Right! But I don't know where to find this XML so I can change the content type ID so it inherits from the WF task. Was this XML created in Visual Studio or is it accessible in SharePoint? Also, do I just create a standard content type and change the contenttype ID in the XML?
    – Steve W
    Commented Aug 28, 2012 at 23:53
  • If anyone is interested, this article got me a little closer to my goal: understandingsharepoint.com/journal/wp-content/…
    – Steve W
    Commented Aug 29, 2012 at 13:45
  • I think you need to understand the content type hierarchy and then read above answer. Here it is msdn.microsoft.com/en-us/library/ms452896.aspx Commented Aug 30, 2012 at 13:11
0

why do you want to create a CT programmatically ? that too in WF ? just curious !

3
  • I am working with an existing system that involves a workflow created in visual studio, which creates a task from the content type. The content types inherit from the "Workflow Task" content type and I don't know how my predecessor created them.
    – Steve W
    Commented Aug 28, 2012 at 22:44
  • What is the reason to create new CT - even though it inherits the WF Tasks ? What will happen to that new CT ? how many items are created out it ? or is it just created for any reference ?
    – kaykay
    Commented Aug 28, 2012 at 22:48
  • The VS workflow creates a task using the content type. The reason I have to create a new one is the user wanted another step/data collection task in the workflow. I have the step created in the workflow, I just need a related content type in sharepoint. But, the content type has to inherit form the workflow task. Something like this:social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/…
    – Steve W
    Commented Aug 28, 2012 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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