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