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 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.

share|improve this question
add comment

2 Answers

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

share|improve this answer
    
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 Aug 28 '12 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 ? –  Kiruthik Aug 28 '12 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 Aug 28 '12 at 22:57
add comment

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>
share|improve this answer
    
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 Aug 28 '12 at 23:53
    
If anyone is interested, this article got me a little closer to my goal: understandingsharepoint.com/journal/wp-content/… –  Steve W Aug 29 '12 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 –  Ashish Patel Aug 30 '12 at 13:11
add comment

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.