简体   繁体   English

总和机会线数量动态 CRM

[英]Sum Opportunity Line Quantity Dynamics CRM

I have a list of opportunity product lines associated to the opportunity.我有一个与机会相关的机会产品线列表。 The products in the opportunity lines are labor based, engineering services.机会线中的产品是基于劳动力的工程服务。 For projecting resource requirements I want to add two fields to my opportunity entity.为了预测资源需求,我想向我的机会实体添加两个字段。

  1. Total Labor Effort总劳动力

This field would be populated by the total quantity of all "labor based" products in the opportunity product lines.该字段将由机会产品线中所有“基于劳动力”的产品的总量填充。

  1. Weighted Labor Effort加权劳动工作量

Same as Total Labor Effort, except the value will be multiplied by the probability of closing the deal.与 Total Labor Effort 相同,但该值将乘以完成交易的概率。 This is a separate custom field in the opportunity.这是机会中的一个单独的自定义字段。

I have tried a roll up field, but I can't seem to get it to sum up the quantity of the products in the product lines.我尝试了一个汇总字段,但我似乎无法用它来总结产品线中的产品数量。 It will only look at the product lines themselves.它只会看产品线本身。 Calculated field seem to be more limited even.甚至计算字段似乎更有限。

What features of Dynamics CRM could help me achieve this? Dynamics CRM 的哪些功能可以帮助我实现这一目标?

If I could add my 2 cents, There is indeed rollup field limitation here.如果我可以加上我的 2 美分,这里确实有汇总字段限制。 Now I could sense 2 ways to achive this.现在我可以感觉到 2 种方法来实现这一目标。

  • Dynamics-365-Workflow-Tools Reason been, this is well documented and up to date with latest CRM Version and especially fucntion query Values Dynamics-365-Workflow-Tools原因是,这是有据可查的,并且是最新的 CRM 版本,尤其是功能查询值
  • If you don't want to add overhead of adding any 3rd party solution may it be free of cost, I would move my logic to Plugins ie custom c# code to perform operations (server side)如果您不想增加添加任何 3rd 方解决方案的开销,它可能是免费的,我会将我的逻辑移至插件,即自定义 c# 代码以执行操作(服务器端)

I personally would go for custom code, you have more control of what you want to achieve there.我个人会选择自定义代码,您可以更好地控制要在那里实现的目标。

I recommend using Kaskela Workflow Elements, a free workflow extension that can query the opportunity products and return the number of line items: https://kaskelasolutions.com/current-query-get-results/我建议使用 Kaskela Workflow Elements,这是一个免费的工作流扩展,可以查询机会产品并返回行项目数: https : //kaskelasolutions.com/current-query-get-results/

After you import Workflow Elements, you will need two workflows: 1. one that is started whenever a product line item is created /modified/deleted and it will update a "trigger" field on the opportunity, such as a "date detail changed" 2. one on the Opportunity that will count the detail lines.导入工作流元素后,您将需要两个工作流: 1. 一个在创建/修改/删除产品线项目时启动,它将更新机会的“触发”字段,例如“更改日期详细信息” 2. 将计算明细行的机会之一。

In the 2nd workflow, use the "Query - Get Results" feature在第二个工作流程中,使用“查询 - 获取结果”功能获取结果

You will need to create a FetchXML query to get the Opportunity Line items - you can use Advanced Find to create the query.您需要创建一个 FetchXML 查询来获取机会行项目 - 您可以使用高级查找来创建查询。 This looks a bit strange because you create the query using the child records and link back to the parent opportunity, but this is how Kaskela filters the results to just the Opportunity Lines that are related to the opportunity.这看起来有点奇怪,因为您使用子记录创建查询并链接回父商机,但这就是 Kaskela 将结果过滤到与商机相关的商机行的方式。 创建 fetchxml

The next step in your workflow is to insert the results into the opportunity record:工作流程的下一步是将结果插入机会记录中: 更新机会表单助手

Ultimately I solved this using MS Flow to retrieve all the Opportunity Line from an "updated" Opportunity and summing them up before finally writing to the Opportunity field.最终,我使用 MS Flow 解决了这个问题,从“更新的”机会中检索所有机会线,并在最终写入机会字段之前将它们汇总。 For weighted value I made a simple calculated field based on the close probability and total labor effort.对于加权值,我根据接近概率和总劳动量做了一个简单的计算字段。

MS FLow Screen Shot MS Flow 屏幕截图

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

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