使用工作流更新子记录
2014-07-10 17:07
465 查看
Ever wish you could use a workflow to update related/child records? For example, when I update the address on an account, update the address on all of the related contacts.You can, with the help of the very helpful CRM 2011 Distribute Workflow Activity assembly written by Alberto Gemin on Codeplex.我应该都非常希望使用工作流来更新主记录的子记录,比如:Address 和 Contract 是1对多关系,那么怎么才能实现更新Address 的时候也批量更新Contract记录呢?虽然系统并没有为我们提供这样的原生支持,但是我们任然可以使用第三方的开源工具来实现这个有意思的需求。While this says “CRM 2011″ in the name, it works fine on CRM 2013 and CRM 2013 SP1.这个工具从4.0开始就存在了,并且现在以及支持最新版本的Dynamics CRM 2013了。下面是使用该工具的步骤:Import the solution from Codeplex
导入下载下来的解决方案
Create your child entity workflow(s). In this example, create a workflow for the contrat entity, check the box to run as a child workflow, uncheck the box to run on create of a record, and add your desired step.
创建一个子类型的工作流,在这个例子里面,我们需要创建一个更新contract实体的字工作流,并把它的在记录创建时运行这个复选框取消,并加上些自己期望的工作流步骤。
Create the master workflow that will trigger the child workflow. In this example it would be a workflow that runs on update of the address fields.
创建一个父工作流,该工作流用来调用刚创建的子工作流,在这个例子里面,它是作用在Address实体上的工作流。
Add a step. If you have successfully deployed the solution, you should see a new step called “DWF AG Utilities:Distribute One to Many.”
如果我们部署成功,你应该能在工作流设计界面的步骤选择菜单中找到“DWF AG Utilities: Distribute One to Many”这样的步骤。
In the step properties you need to specify two values: the database name of the 1:N relationship and the child workflow you created in step 2.
为"DWF AG Utilities: Distribute One to Many”步骤指定相应的值:刚创建的子工作流,父实体和子实体直接的关系名称。
Publish the workflow.
发布工作里
Now, every time the master workflow is executed, it will run the child workflow on each related record. This works with both background (asynchronous) and real-time (synchronous) workflow processes.
这样我们就可以借助这个第三方的工作流来更新系统啦,它分别支持同步和异步类型的工作流。
导入下载下来的解决方案
Create your child entity workflow(s). In this example, create a workflow for the contrat entity, check the box to run as a child workflow, uncheck the box to run on create of a record, and add your desired step.
创建一个子类型的工作流,在这个例子里面,我们需要创建一个更新contract实体的字工作流,并把它的在记录创建时运行这个复选框取消,并加上些自己期望的工作流步骤。
Create the master workflow that will trigger the child workflow. In this example it would be a workflow that runs on update of the address fields.
创建一个父工作流,该工作流用来调用刚创建的子工作流,在这个例子里面,它是作用在Address实体上的工作流。
Add a step. If you have successfully deployed the solution, you should see a new step called “DWF AG Utilities:Distribute One to Many.”
如果我们部署成功,你应该能在工作流设计界面的步骤选择菜单中找到“DWF AG Utilities: Distribute One to Many”这样的步骤。
In the step properties you need to specify two values: the database name of the 1:N relationship and the child workflow you created in step 2.
为"DWF AG Utilities: Distribute One to Many”步骤指定相应的值:刚创建的子工作流,父实体和子实体直接的关系名称。
Publish the workflow.
发布工作里
Now, every time the master workflow is executed, it will run the child workflow on each related record. This works with both background (asynchronous) and real-time (synchronous) workflow processes.
这样我们就可以借助这个第三方的工作流来更新系统啦,它分别支持同步和异步类型的工作流。
相关文章推荐
- 使用工作流更新子记录
- 在Linq to Sql中管理并发更新时的冲突(3):使用记录的时间戳进行检测
- ado.net 操作excel 问题记录 -- 操作必须使用一个可更新的查询
- 纯手工打造漂亮的垂直时间轴,使用最简单的HTML+CSS+JQUERY完成100个版本更新记录的华丽转身!
- 纯手工打造漂亮的垂直时间轴,使用最简单的HTML+CSS+JQUERY完成100个版本更新记录的华丽转身!
- 纯手工打造漂亮的垂直时间轴,使用最简单的HTML+CSS+JQUERY完成100个版本更新记录的华丽转身!
- 在Linq to Sql中管理并发更新时的冲突(3):使用记录的时间戳进行检测
- Altium Designer(DXP)使用记录,持续更新
- 纯手工打造漂亮的垂直时间轴,使用最简单的HTML+CSS+JQUERY完成100个版本更新记录的华丽转身!
- mysql:使用已有的记录更新另一条数据
- 记录g++命令中经常使用的参数(持续更新中......)
- Sqlserver 2005使用XML一次更新多条记录的方法
- 使用NdbUnit更新数据报“违反并发性 updatecommand 影响了预期 1 条记录中的 0 条”错误的原因
- 对数据库根据符合条件的记录 逐个进行更新使用的连接语句
- 纯手工打造漂亮的垂直时间轴,使用最简单的HTML+CSS+JQUERY完成100个版本更新记录...
- 使用DataSet更新记录
- 使用DataSet更新记录
- 使用ezsql,更新记录时,新记录与原记录相同时的返回值
- [置顶] 纯手工打造漂亮的垂直时间轴,使用最简单的HTML+CSS+JQUERY完成100个版本更新记录的华丽转身!
- ADO.NET 更新数据库的2种方式::(1)使用DataSet对象更新数据集;(2)使用SqlCommand对象更新单条记录