RE: createtaskwithcontenttype

2009-05-18 Thread Jeffery Tsui
I would suggest you to create a separate feature for the custom content
type.

 

Robert Shelton had a series of how to videos about custom workflow
development which is very helpful (to me).
http://sheltonblog.com/archive/2007/11/21/how-to-video-building-a-basic-appr
oval-workflow-with-sharepoint.aspx

 

 

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Chris Milne
Sent: Tuesday, 19 May 2009 1:24 PM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

 

Many thanks Brian & Jeffery.  I was a little unclear on the use of the term
'feature', now it's all coming clear..  so my workflow project is already
being pushed out as a feature, I can just add my content type to an existing
or new element manifest, referenced from feature.xml.  Sounds great..
thanks.

 

 

Kind regards,

 

Chris

 

 

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian
Farnhill
Sent: Tuesday, 19 May 2009 1:12 PM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

 

That's in a feature, so generally in a feature you have your feature.xml
file, and one or more elements XML files (if you just have one it is
generally called elements.xml)

 

Check out SPDevWiki for info on features and how to make them -
http://sharepointdevwiki.com/display/public/Features

 

Brian Farnhill 
Consultant
Technical Consulting 

Mobile:   0408 289 303
Email: <mailto:brian.farnh...@uniqueworld.net>
brian.farnh...@uniqueworld.net
Web:  <http://www.uniqueworld.net> www.uniqueworld.net
Blog:  <http://blog.brianfarnhill.com/> blog.brianfarnhill.com

  _  

From: ozmoss@ozmoss.com [ozm...@ozmoss.com] On Behalf Of Chris Milne
[chris.mi...@dataaspects.com.au]
Sent: Tuesday, 19 May 2009 1:01 PM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

Thanks Brian.

 

Elements file.. is that in a site definition?  Do you need to create one to
implement that?  So far I've just created the workflow project. 

 

 

Kind regards,

 

Chris

 

 

 

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian
Farnhill
Sent: Tuesday, 19 May 2009 11:18 AM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

 

Create a content type that inherits from the workflow task one - we did that
via a feature. So something like this in your elements file should so it:

 



 

This creates a CT that inherits from the workflow task one, and from here in
that XML I can add fields to it like any other content type deployed via a
feature to store my own data.

 

I hope that helps.

 

Brian Farnhill 
Consultant
Technical Consulting 

Mobile:   0408 289 303
Email: <mailto:brian.farnh...@uniqueworld.net>
brian.farnh...@uniqueworld.net
Web:  <http://www.uniqueworld.net> www.uniqueworld.net
Blog:  <http://blog.brianfarnhill.com/> blog.brianfarnhill.com

  _  

From: ozmoss@ozmoss.com [ozm...@ozmoss.com] On Behalf Of Chris Milne
[chris.mi...@dataaspects.com.au]
Sent: Tuesday, 19 May 2009 10:57 AM
To: ozmoss@ozmoss.com
Subject: createtaskwithcontenttype

Morning all,

 

I'm creating a SharePoint workflow in VS and am having trouble implementing
createtaskwithcontenttype.  Here's what I'm getting when I run the workflow:

 

Workflow1.  Information: System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. --->
System.ArgumentException: The content type of a workflow task must be
derived from the Workflow Task content type.

 

And here's what I'm doing:

 

In the portal..

-  Created a content type on my site, let's call it 'abc', derived
from List / Task 

-  Enabled content types on my task list

-  Added abc as a content type to my task list

-  Can manually create a task of this CT in this list

-   

 

In VS...

-  Plopped down a 'createtaskwithcontenttype' (createTask1) and
'completetask' activity.  Left 'ContentTypeId' property of the
createtaskwithcontenttype' blank in the properties window

-  Populated the correlation tokens, task properties and task id's
(works fine if i use a 'createtask' instead)

-  Grabbing the SPContentTypeId of abc in a code activity before the
createtaskwithcontenttype

-  Setting: createTask1.ContentTypeId = abcContentTypeId.ToString()
at the start of createTask1_MethodInvoking()

 

Okay, so I've just realised that my CT is derived from List / Task, but it's
expecting it to be derived from "Workflow Task".  I know this is the CT it
uses if you instead use a 'createtask' activity, but how can you create a
user-defined CT that derives from "Workflow Task"?

 

 

Kind regards,

 

Chris

 

 

 

  _  

Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com

Subscribe: ozmoss-subscr...@ozmoss.

RE: createtaskwithcontenttype

2009-05-18 Thread Chris Milne
Many thanks Brian & Jeffery.  I was a little unclear on the use of the
term 'feature', now it's all coming clear..  so my workflow project is
already being pushed out as a feature, I can just add my content type to
an existing or new element manifest, referenced from feature.xml.
Sounds great.. thanks.

 

 

Kind regards,

 

Chris

 

 

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian
Farnhill
Sent: Tuesday, 19 May 2009 1:12 PM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

 

That's in a feature, so generally in a feature you have your feature.xml
file, and one or more elements XML files (if you just have one it is
generally called elements.xml)

 

Check out SPDevWiki for info on features and how to make them -
http://sharepointdevwiki.com/display/public/Features

 

Brian Farnhill 
Consultant
Technical Consulting 

Mobile:   0408 289 303
Email:brian.farnh...@uniqueworld.net
<mailto:brian.farnh...@uniqueworld.net> 
Web: www.uniqueworld.net <http://www.uniqueworld.net> 
Blog: blog.brianfarnhill.com <http://blog.brianfarnhill.com/> 



From: ozmoss@ozmoss.com [ozm...@ozmoss.com] On Behalf Of Chris Milne
[chris.mi...@dataaspects.com.au]
Sent: Tuesday, 19 May 2009 1:01 PM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

Thanks Brian.

 

Elements file.. is that in a site definition?  Do you need to create one
to implement that?  So far I've just created the workflow project. 

 

 

Kind regards,

 

Chris

 

 

 

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian
Farnhill
Sent: Tuesday, 19 May 2009 11:18 AM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

 

Create a content type that inherits from the workflow task one - we did
that via a feature. So something like this in your elements file should
so it:

 



 

This creates a CT that inherits from the workflow task one, and from
here in that XML I can add fields to it like any other content type
deployed via a feature to store my own data.

 

I hope that helps.

 

Brian Farnhill 
Consultant
Technical Consulting 

Mobile:   0408 289 303
Email:brian.farnh...@uniqueworld.net
<mailto:brian.farnh...@uniqueworld.net> 
Web: www.uniqueworld.net <http://www.uniqueworld.net> 
Blog: blog.brianfarnhill.com <http://blog.brianfarnhill.com/> 



From: ozmoss@ozmoss.com [ozm...@ozmoss.com] On Behalf Of Chris Milne
[chris.mi...@dataaspects.com.au]
Sent: Tuesday, 19 May 2009 10:57 AM
To: ozmoss@ozmoss.com
Subject: createtaskwithcontenttype

Morning all,

 

I'm creating a SharePoint workflow in VS and am having trouble
implementing createtaskwithcontenttype.  Here's what I'm getting when I
run the workflow:

 

Workflow1.  Information: System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. --->
System.ArgumentException: The content type of a workflow task must be
derived from the Workflow Task content type.

 

And here's what I'm doing:

 

In the portal..

-  Created a content type on my site, let's call it 'abc',
derived from List / Task 

-  Enabled content types on my task list

-  Added abc as a content type to my task list

-  Can manually create a task of this CT in this list

-   

 

In VS...

-  Plopped down a 'createtaskwithcontenttype' (createTask1) and
'completetask' activity.  Left 'ContentTypeId' property of the
createtaskwithcontenttype' blank in the properties window

-  Populated the correlation tokens, task properties and task
id's (works fine if i use a 'createtask' instead)

-  Grabbing the SPContentTypeId of abc in a code activity before
the createtaskwithcontenttype

-  Setting: createTask1.ContentTypeId =
abcContentTypeId.ToString() at the start of createTask1_MethodInvoking()

 

Okay, so I've just realised that my CT is derived from List / Task, but
it's expecting it to be derived from "Workflow Task".  I know this is
the CT it uses if you instead use a 'createtask' activity, but how can
you create a user-defined CT that derives from "Workflow Task"?

 

 

Kind regards,

 

Chris

 

 

 



Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com

Subscribe: ozmoss-subscr...@ozmoss.com

Unsubscribe: ozmoss-unsubscr...@ozmoss.com

List FAQ: http://www.codify.com/lists/ozmoss
<http://www.codify.com/lists/ozmoss> 

Other lists you might want to join: http://www.codify.com/lists
<http://www.codify.com/lists> 



Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com

Subscribe: ozmoss-subscr...@ozmoss.com

Unsubscrib

RE: createtaskwithcontenttype

2009-05-18 Thread Brian Farnhill
That's in a feature, so generally in a feature you have your feature.xml file, 
and one or more elements XML files (if you just have one it is generally called 
elements.xml)

Check out SPDevWiki for info on features and how to make them - 
http://sharepointdevwiki.com/display/public/Features

Brian Farnhill
Consultant
Technical Consulting

Mobile:   0408 289 303
Email:brian.farnh...@uniqueworld.net<mailto:brian.farnh...@uniqueworld.net>
Web: www.uniqueworld.net<http://www.uniqueworld.net>
Blog: blog.brianfarnhill.com<http://blog.brianfarnhill.com/>

From: ozmoss@ozmoss.com [ozm...@ozmoss.com] On Behalf Of Chris Milne 
[chris.mi...@dataaspects.com.au]
Sent: Tuesday, 19 May 2009 1:01 PM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

Thanks Brian.

Elements file.. is that in a site definition?  Do you need to create one to 
implement that?  So far I’ve just created the workflow project.


Kind regards,

Chris



From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian Farnhill
Sent: Tuesday, 19 May 2009 11:18 AM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

Create a content type that inherits from the workflow task one - we did that 
via a feature. So something like this in your elements file should so it:




This creates a CT that inherits from the workflow task one, and from here in 
that XML I can add fields to it like any other content type deployed via a 
feature to store my own data.

I hope that helps.

Brian Farnhill
Consultant
Technical Consulting

Mobile:   0408 289 303
Email:brian.farnh...@uniqueworld.net<mailto:brian.farnh...@uniqueworld.net>
Web: www.uniqueworld.net<http://www.uniqueworld.net>
Blog: blog.brianfarnhill.com<http://blog.brianfarnhill.com/>

From: ozmoss@ozmoss.com [ozm...@ozmoss.com] On Behalf Of Chris Milne 
[chris.mi...@dataaspects.com.au]
Sent: Tuesday, 19 May 2009 10:57 AM
To: ozmoss@ozmoss.com
Subject: createtaskwithcontenttype
Morning all,

I’m creating a SharePoint workflow in VS and am having trouble implementing 
createtaskwithcontenttype.  Here’s what I’m getting when I run the workflow:

Workflow1.  Information: System.Reflection.TargetInvocationException: Exception 
has been thrown by the target of an invocation. ---> System.ArgumentException: 
The content type of a workflow task must be derived from the Workflow Task 
content type.

And here’s what I’m doing:

In the portal..

-  Created a content type on my site, let’s call it ‘abc’, derived from 
List / Task

-  Enabled content types on my task list

-  Added abc as a content type to my task list

-  Can manually create a task of this CT in this list

-

In VS...

-  Plopped down a ‘createtaskwithcontenttype’ (createTask1) and 
‘completetask’ activity.  Left ‘ContentTypeId’ property of the 
createtaskwithcontenttype’ blank in the properties window

-  Populated the correlation tokens, task properties and task id’s 
(works fine if i use a ‘createtask’ instead)

-  Grabbing the SPContentTypeId of abc in a code activity before the 
createtaskwithcontenttype

-  Setting: createTask1.ContentTypeId = abcContentTypeId.ToString() at 
the start of createTask1_MethodInvoking()

Okay, so I’ve just realised that my CT is derived from List / Task, but it’s 
expecting it to be derived from “Workflow Task”.  I know this is the CT it uses 
if you instead use a ‘createtask’ activity, but how can you create a 
user-defined CT that derives from “Workflow Task”?


Kind regards,

Chris




Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists

Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists

Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists

Support procedure: http://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists



RE: createtaskwithcontenttype

2009-05-18 Thread Brian Farnhill
Also, one thing I ran into with this as well was making sure that your workflow 
tasks are associated with the task list before you use createtaskwithcontenttype

When you associate a workflow you can specify a default task content type ID - 
in my scenario I had multiple task content types, so I put in a code action at 
the very start of the workflow that checked to make sure the required 
additional content types were associated with the tasks list.

Brian Farnhill
Consultant
Technical Consulting

Mobile:   0408 289 303
Email:brian.farnh...@uniqueworld.net<mailto:brian.farnh...@uniqueworld.net>
Web: www.uniqueworld.net<http://www.uniqueworld.net>
Blog: blog.brianfarnhill.com<http://blog.brianfarnhill.com/>

From: ozmoss@ozmoss.com [ozm...@ozmoss.com] On Behalf Of Jeffery Tsui 
[jeffe...@antaressolutions.com.au]
Sent: Tuesday, 19 May 2009 1:00 PM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

I also prefer to use feature to deploy custom content type, especially custom 
workflow task which allows you to easily manage custom columns and form 
association.

The default workflow task content type has ContentType ID=0x010801 , you will 
need to add “00” before appending GUID without “-“. Eg. 
0x01080100113E21589FD845e281EFD2F7E3D88D5B

Remember to use CreateTaskWithContentType action and point the ContentTypeId to 
the custom content type id.



From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian Farnhill
Sent: Tuesday, 19 May 2009 11:18 AM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

Create a content type that inherits from the workflow task one - we did that 
via a feature. So something like this in your elements file should so it:




This creates a CT that inherits from the workflow task one, and from here in 
that XML I can add fields to it like any other content type deployed via a 
feature to store my own data.

I hope that helps.

Brian Farnhill
Consultant
Technical Consulting

Mobile:   0408 289 303
Email:brian.farnh...@uniqueworld.net<mailto:brian.farnh...@uniqueworld.net>
Web: www.uniqueworld.net<http://www.uniqueworld.net>
Blog: blog.brianfarnhill.com<http://blog.brianfarnhill.com/>

From: ozmoss@ozmoss.com [ozm...@ozmoss.com] On Behalf Of Chris Milne 
[chris.mi...@dataaspects.com.au]
Sent: Tuesday, 19 May 2009 10:57 AM
To: ozmoss@ozmoss.com
Subject: createtaskwithcontenttype
Morning all,

I’m creating a SharePoint workflow in VS and am having trouble implementing 
createtaskwithcontenttype.  Here’s what I’m getting when I run the workflow:

Workflow1.  Information: System.Reflection.TargetInvocationException: Exception 
has been thrown by the target of an invocation. ---> System.ArgumentException: 
The content type of a workflow task must be derived from the Workflow Task 
content type.

And here’s what I’m doing:

In the portal..

-  Created a content type on my site, let’s call it ‘abc’, derived from 
List / Task

-  Enabled content types on my task list

-  Added abc as a content type to my task list

-  Can manually create a task of this CT in this list

-

In VS...

-  Plopped down a ‘createtaskwithcontenttype’ (createTask1) and 
‘completetask’ activity.  Left ‘ContentTypeId’ property of the 
createtaskwithcontenttype’ blank in the properties window

-  Populated the correlation tokens, task properties and task id’s 
(works fine if i use a ‘createtask’ instead)

-  Grabbing the SPContentTypeId of abc in a code activity before the 
createtaskwithcontenttype

-  Setting: createTask1.ContentTypeId = abcContentTypeId.ToString() at 
the start of createTask1_MethodInvoking()

Okay, so I’ve just realised that my CT is derived from List / Task, but it’s 
expecting it to be derived from “Workflow Task”.  I know this is the CT it uses 
if you instead use a ‘createtask’ activity, but how can you create a 
user-defined CT that derives from “Workflow Task”?


Kind regards,

Chris




Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists

Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists

Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might wa

RE: createtaskwithcontenttype

2009-05-18 Thread Chris Milne
Thanks Brian.

 

Elements file.. is that in a site definition?  Do you need to create one
to implement that?  So far I've just created the workflow project. 

 

 

Kind regards,

 

Chris

 

 

 

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian
Farnhill
Sent: Tuesday, 19 May 2009 11:18 AM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

 

Create a content type that inherits from the workflow task one - we did
that via a feature. So something like this in your elements file should
so it:

 



 

This creates a CT that inherits from the workflow task one, and from
here in that XML I can add fields to it like any other content type
deployed via a feature to store my own data.

 

I hope that helps.

 

Brian Farnhill 
Consultant
Technical Consulting 

Mobile:   0408 289 303
Email:brian.farnh...@uniqueworld.net
<mailto:brian.farnh...@uniqueworld.net> 
Web: www.uniqueworld.net <http://www.uniqueworld.net> 
Blog: blog.brianfarnhill.com <http://blog.brianfarnhill.com/> 



From: ozmoss@ozmoss.com [ozm...@ozmoss.com] On Behalf Of Chris Milne
[chris.mi...@dataaspects.com.au]
Sent: Tuesday, 19 May 2009 10:57 AM
To: ozmoss@ozmoss.com
Subject: createtaskwithcontenttype

Morning all,

 

I'm creating a SharePoint workflow in VS and am having trouble
implementing createtaskwithcontenttype.  Here's what I'm getting when I
run the workflow:

 

Workflow1.  Information: System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. --->
System.ArgumentException: The content type of a workflow task must be
derived from the Workflow Task content type.

 

And here's what I'm doing:

 

In the portal..

-  Created a content type on my site, let's call it 'abc',
derived from List / Task 

-  Enabled content types on my task list

-  Added abc as a content type to my task list

-  Can manually create a task of this CT in this list

-   

 

In VS...

-  Plopped down a 'createtaskwithcontenttype' (createTask1) and
'completetask' activity.  Left 'ContentTypeId' property of the
createtaskwithcontenttype' blank in the properties window

-  Populated the correlation tokens, task properties and task
id's (works fine if i use a 'createtask' instead)

-  Grabbing the SPContentTypeId of abc in a code activity before
the createtaskwithcontenttype

-  Setting: createTask1.ContentTypeId =
abcContentTypeId.ToString() at the start of createTask1_MethodInvoking()

 

Okay, so I've just realised that my CT is derived from List / Task, but
it's expecting it to be derived from "Workflow Task".  I know this is
the CT it uses if you instead use a 'createtask' activity, but how can
you create a user-defined CT that derives from "Workflow Task"?

 

 

Kind regards,

 

Chris

 

 

 



Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com

Subscribe: ozmoss-subscr...@ozmoss.com

Unsubscribe: ozmoss-unsubscr...@ozmoss.com

List FAQ: http://www.codify.com/lists/ozmoss
<http://www.codify.com/lists/ozmoss> 

Other lists you might want to join: http://www.codify.com/lists
<http://www.codify.com/lists> 



Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com

Subscribe: ozmoss-subscr...@ozmoss.com

Unsubscribe: ozmoss-unsubscr...@ozmoss.com

List FAQ: http://www.codify.com/lists/ozmoss
<http://www.codify.com/lists/ozmoss> 

Other lists you might want to join: http://www.codify.com/lists
<http://www.codify.com/lists> 


Support procedure: http://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists



RE: createtaskwithcontenttype

2009-05-18 Thread Jeffery Tsui
I also prefer to use feature to deploy custom content type, especially
custom workflow task which allows you to easily manage custom columns and
form association. 

 

The default workflow task content type has ContentType ID=0x010801 , you
will need to add "00" before appending GUID without "-". Eg.
0x01080100113E21589FD845e281EFD2F7E3D88D5B

 

Remember to use CreateTaskWithContentType action and point the ContentTypeId
to the custom content type id.

 

 

 

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian
Farnhill
Sent: Tuesday, 19 May 2009 11:18 AM
To: ozmoss@ozmoss.com
Subject: RE: createtaskwithcontenttype

 

Create a content type that inherits from the workflow task one - we did that
via a feature. So something like this in your elements file should so it:

 



 

This creates a CT that inherits from the workflow task one, and from here in
that XML I can add fields to it like any other content type deployed via a
feature to store my own data.

 

I hope that helps.

 

Brian Farnhill 
Consultant
Technical Consulting 

Mobile:   0408 289 303
Email: <mailto:brian.farnh...@uniqueworld.net>
brian.farnh...@uniqueworld.net
Web:  <http://www.uniqueworld.net> www.uniqueworld.net
Blog:  <http://blog.brianfarnhill.com/> blog.brianfarnhill.com

  _  

From: ozmoss@ozmoss.com [ozm...@ozmoss.com] On Behalf Of Chris Milne
[chris.mi...@dataaspects.com.au]
Sent: Tuesday, 19 May 2009 10:57 AM
To: ozmoss@ozmoss.com
Subject: createtaskwithcontenttype

Morning all,

 

I'm creating a SharePoint workflow in VS and am having trouble implementing
createtaskwithcontenttype.  Here's what I'm getting when I run the workflow:

 

Workflow1.  Information: System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. --->
System.ArgumentException: The content type of a workflow task must be
derived from the Workflow Task content type.

 

And here's what I'm doing:

 

In the portal..

-  Created a content type on my site, let's call it 'abc', derived
from List / Task 

-  Enabled content types on my task list

-  Added abc as a content type to my task list

-  Can manually create a task of this CT in this list

-   

 

In VS...

-  Plopped down a 'createtaskwithcontenttype' (createTask1) and
'completetask' activity.  Left 'ContentTypeId' property of the
createtaskwithcontenttype' blank in the properties window

-  Populated the correlation tokens, task properties and task id's
(works fine if i use a 'createtask' instead)

-  Grabbing the SPContentTypeId of abc in a code activity before the
createtaskwithcontenttype

-  Setting: createTask1.ContentTypeId = abcContentTypeId.ToString()
at the start of createTask1_MethodInvoking()

 

Okay, so I've just realised that my CT is derived from List / Task, but it's
expecting it to be derived from "Workflow Task".  I know this is the CT it
uses if you instead use a 'createtask' activity, but how can you create a
user-defined CT that derives from "Workflow Task"?

 

 

Kind regards,

 

Chris

 

 

 

  _  

Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com

Subscribe: ozmoss-subscr...@ozmoss.com

Unsubscribe: ozmoss-unsubscr...@ozmoss.com

List FAQ:  <http://www.codify.com/lists/ozmoss>
http://www.codify.com/lists/ozmoss

Other lists you might want to join:  <http://www.codify.com/lists>
http://www.codify.com/lists

  _  

Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com

Subscribe: ozmoss-subscr...@ozmoss.com

Unsubscribe: ozmoss-unsubscr...@ozmoss.com

List FAQ:  <http://www.codify.com/lists/ozmoss>
http://www.codify.com/lists/ozmoss

Other lists you might want to join:  <http://www.codify.com/lists>
http://www.codify.com/lists


Support procedure: http://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists



RE: createtaskwithcontenttype

2009-05-18 Thread Brian Farnhill
Create a content type that inherits from the workflow task one - we did that 
via a feature. So something like this in your elements file should so it:





This creates a CT that inherits from the workflow task one, and from here in 
that XML I can add fields to it like any other content type deployed via a 
feature to store my own data.

I hope that helps.

Brian Farnhill
Consultant
Technical Consulting

Mobile:   0408 289 303
Email:brian.farnh...@uniqueworld.net
Web: www.uniqueworld.net
Blog: blog.brianfarnhill.com

From: ozmoss@ozmoss.com [ozm...@ozmoss.com] On Behalf Of Chris Milne 
[chris.mi...@dataaspects.com.au]
Sent: Tuesday, 19 May 2009 10:57 AM
To: ozmoss@ozmoss.com
Subject: createtaskwithcontenttype

Morning all,

I’m creating a SharePoint workflow in VS and am having trouble implementing 
createtaskwithcontenttype.  Here’s what I’m getting when I run the workflow:

Workflow1.  Information: System.Reflection.TargetInvocationException: Exception 
has been thrown by the target of an invocation. ---> System.ArgumentException: 
The content type of a workflow task must be derived from the Workflow Task 
content type.

And here’s what I’m doing:

In the portal..

-  Created a content type on my site, let’s call it ‘abc’, derived from 
List / Task

-  Enabled content types on my task list

-  Added abc as a content type to my task list

-  Can manually create a task of this CT in this list

-

In VS...

-  Plopped down a ‘createtaskwithcontenttype’ (createTask1) and 
‘completetask’ activity.  Left ‘ContentTypeId’ property of the 
createtaskwithcontenttype’ blank in the properties window

-  Populated the correlation tokens, task properties and task id’s 
(works fine if i use a ‘createtask’ instead)

-  Grabbing the SPContentTypeId of abc in a code activity before the 
createtaskwithcontenttype

-  Setting: createTask1.ContentTypeId = abcContentTypeId.ToString() at 
the start of createTask1_MethodInvoking()

Okay, so I’ve just realised that my CT is derived from List / Task, but it’s 
expecting it to be derived from “Workflow Task”.  I know this is the CT it uses 
if you instead use a ‘createtask’ activity, but how can you create a 
user-defined CT that derives from “Workflow Task”?


Kind regards,

Chris




Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists

Support procedure: http://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists