CRM 2011 Executing a FetchXML Group Using a Custom Parameter Value

I want to be able to execute a FetchXML query that sums the value when grouped into a field, which is a custom option, but I don't get the expected results.

All that is returned is the total values, not the value of the custom parameter to which it refers, so I don’t know what the returned values ​​are.

This is a fetchXML request that looks 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> 

Each return value has only 1 attribute ... value_sum_possibility.

If I group, say, a customer identifier, then the returned values ​​are summed correctly, and the link is returned to the corresponding client for each total value that I expect.

Is it not possible to group a custom parameter value? This seems to work just fine with standard values ​​for given system parameters, such as a status code.

+4
source share
1 answer

I checked that your xetch xetch works just fine while the data is clean. If all your koo_opportunitytype values ​​for features are equal to zero, they will not return an attribute for them. I assume that you get only one object? Also, if any estimated value for the group is null, the amount is also not returned. This means that you probably want to add a filter to exclude zero values ​​from your sum.

+3
source

All Articles