CRM 2011 Performing FetchXML组按自定义选项设置值 [英] CRM 2011 Performing FetchXML group by on custom option set value

查看:114
本文介绍了CRM 2011 Performing FetchXML组按自定义选项设置值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够执行FetchXML请求,该请求在对作为自定义选项集的字段进行分组时会求一个值的总和,但是我没有得到预期的结果。

I want to be able to perform a FetchXML request that sums a value while grouping on a field that is a custom option set but I don't get the expected results.

返回的所有值都是累加值,而不是与之相关的自定义选项设置值,因此我不知道返回值与什么有关。

All that is returned is the summed up values, not the related custom option set value that it relates to so I have no idea what the returned values relate to.

这是看起来正确的fetchXML请求:

This is the fetchXML request which appears to be correct:

<fetch distinct='false' mapping='logical' aggregate='true'> 
    <entity name='opportunity'> 
          <attribute name='estimatedvalue' alias='opportunity_sum' aggregate='sum' /> 
          <attribute name='koo_opportunitytype' alias='koo_opportunitytype' groupby='true' /> 
    </entity> 
</fetch>

每个返回的值仅具有1个属性... 机会总和值。

Each value that is returned only has 1 attribute...the opportunity_sum value.

如果我按客户ID分组,则返回的值将正确汇总,并为每个汇总值返回参考给相关客户,这就是我会期望的。

If I group by say, customer id, then the returned values are summed up correctly and a reference is returned to the related customer for each summed value which is what I would expect.

是否无法按自定义选项设置值分组?

Is it not possible to group by a custom option set value? This seems to work fine with standard system option set values such as status code.

推荐答案

我已经证实您的提取xml可以正常工作只要数据干净就可以。如果机会的所有 koo_opportunitytype 值都为空,则不会为它们返回属性。我假设您只得到一个实体退货?同样,如果某个组的任何估计值为null,则总和也不会返回。这意味着您可能要添加一个过滤器,以从总和中排除空值。

I have verified that your fetch xml works just fine as long as the data is clean. If all of your koo_opportunitytype values for opportunities are null, it will not return an attribute for them. I'm assuming that you're only getting one entity returned? Also if any estimated value is null for a group, the sum will not be returned either. This means you'll probably want to add a filter to exclude null values from your sum.

这篇关于CRM 2011 Performing FetchXML组按自定义选项设置值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆