views:

251

answers:

2

I have a workflow on an opportunity. I am trying to count the number activities from the opportunity workflow.

And use this count on condition within the workflow.

+1  A: 

I don't believe there's a way to accomplish this natively in the workflow engine. You'll have to create a custom workflow activity that gets this count for you and then returns it to the workflow, and then you can use it within your condition.

An example of some custom activities on CodePlex: http://crm4activities.codeplex.com/

Custom workflow activity documentation on MSDN: http://msdn.microsoft.com/en-us/library/cc151142.aspx

Matt
+1  A: 

I agree with Matt's answer. You need to hook a custom workflow activity in order to get the Opportunity object that you are currently interesting on, and finally inside the custom workflow activity, you can use CRM SDK to find the related activites regarding the opportunity.

Here is the link to setup a basic custom workflow activity : http://www.stunnware.com/crm2/topic.aspx?id=CustomWorkflowActivity

hadi teo
I had to create a custom activity. good fun. I must blog about it
Chris Jones