简体   繁体   English

CRM:在 C# 中创建工作流和工作流自定义活动的区别

[英]CRM: Difference between creating Workflow and Workflow custom activity in C#

I want to make workflow using C#.我想使用 C# 制作工作流。

I was searching about this and found that there are Workflows and Workflow custom activities.我正在搜索这个,发现有工作流和工作流自定义活动。

What is the difference between these two.这两者有什么区别。

For example I have custom activity entity containing some products and I want to make a Workflow that would transform it to opportunity(by overriding default TO OPPORTUNITY custom button) and copy all the products to the new opportunity.例如,我有包含一些产品的自定义活动实体,我想制作一个将其转换为机会的工作流(通过覆盖默认的 TO OPPORTUNITY 自定义按钮)并将所有产品复制到新机会。

What should I use for this?我应该为此使用什么?

Both workflows and custom workflow activities are used to automate business processes.工作流和自定义工作流活动都用于自动化业务流程。 When a custom workflow activity can be used depends on the limitations of out of the box workflow and complexity of the business process.何时可以使用自定义工作流活动取决于现成工作流的限制和业务流程的复杂性。 Something as little as calculations and as complex as calling a web service can only be done using custom workflow activities.像计算这样小而像调用 Web 服务这样复杂的事情只能使用自定义工作流活动来完成。

In your case, you need a plugin, not a workflow as the Convert To Opportunity is a CRM internal business process.在您的情况下,您需要一个插件,而不是工作流,因为Convert To Opportunity是一个 CRM 内部业务流程。 Couple of options, choose one that best suits your scenario:几个选项,选择最适合您的场景的选项:

Option 1 : Register a plugin on the post-update of the activity.选项 1 :在活动更新后注册一个插件。 Check to see if regardingobjectid attribute is updated, if the attribute exists it would mean the update was part of the convert operation.检查是否更新了regardingobjectid属性,如果该属性存在,则意味着更新是转换操作的一部分。 You can then update the opportunity(regardingobjectid) with the information you want.然后,您可以使用所需的信息更新opportunity(regardingobjectid)

Option 2 : Register a plugin on create of an opportunity , query for all associated activities, if there is an associated activity, it was created by the convert operation.选项 2 :在创建opportunity注册插件,查询所有关联活动,如果有关联活动,则由转换操作创建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM