-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group-By Attributes not returned in Aggregated Query #48
Group-By Attributes not returned in Aggregated Query #48
Comments
Here's a unit test for this with OOB attrbutes. It fails because the grouped by column doesn't appear in the resultset. It's the equivalent of this SQL query:
The 'name' column does not appear in the results of the query. |
@jordimontana82 @bwmodular the following test works: [Fact]
public void When_An_Aggregated_Query_Contains_Group_By_On_Base_Attributes_These_Should_Be_Returned_In_The_Query_Results()
{
EntityCollection records = _service.RetrieveMultiple(new FetchExpression(@"<fetch aggregate='true'>
<entity name='salesorderdetail'>
<attribute name='salesorderdetailid' alias='count' aggregate='count' />
<attribute name='lineitemnumber' alias='lineitemnumber' groupby='true' />
</entity>
</fetch>"));
Assert.Equal(1, (int)((AliasedValue)records.Entities[0]["lineitemnumber"]).Value);
} which means the problem is only limited to |
Might be the same as jordimontana82/fake-xrm-easy#482 in v1. |
@filcole I think I didn't solve that problem with my PR... if that is the case do you mind issuing a PR against https://github.com/BetimBeja/dynamicsvalue-fake-xrm-easy-core/tree/fix/2x/issue-48 which would add your commits to DynamicsValue/fake-xrm-easy-core#30 ? I wrote a blog about the process some time ago: https://xrm.al/blog/co-author-github |
Confirmed that the bug you raised on v1 is not fixed with DynamicsValue/fake-xrm-easy-core#30 |
Thanks lads @filcole @BetimBeja @bwmodular |
Here's a fetchXml query. It returns the count of 'work notification jobs', grouped by technician name, number and id.
When run against a real (d365 online) instance, the grouped by columns are returned in the query:
When run against FakeXrmEasy v1,2 or 3 the AttributeCollection returned by the query only contains the count, but not the group by columns:
I'm not sure if this a known issue from v1. I can provide a failing test if required, using OOB entities.
The text was updated successfully, but these errors were encountered: