Which attribute triggered my CRM 4.0 workflow
I have a CRM 4.0 workflow with a custom workflow activity. This workflow is triggered on select attribute updates of accounts. The selected attributes is a list of 20-30 fields. Is there a way 开发者_运维知识库to find which attributes triggered the workflow in CRM 4.0 (i.e. attributes have changed) without creating a separate workflow for each attribute or using auditing?
A workflow is really just a fancy asynchronous plugin. This article has a great explanation: http://blogs.msdn.com/b/crm/archive/2009/06/24/microsoft-dynamics-crm-4-0-iworkflowcontext-interface.aspx
Notice you can access the InputParameters collection from the workflow context. This should contain your TargetEntity just like in normal plugin programming. The TargetEntity will only contain fields that changed, so you can loop through that collection to discover which field updates triggered the workflow.
精彩评论