Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses the common issue of columns in results not matching the query - see #289, #275, + others closed as duplicates.
All selected columns should now be displayed even if they don't contain data, and no extra columns that weren't selected but the server returns anyway (e.g. transactioncurrencyid when selecting a money field).
Columns will be shown in the order shown in the tree view. This would work previously, but only if all link entities had an explicit alias. This change calculates what the system-generated alias will be for any that aren't explicitly defined.
I can't see any official documentation describing how the system generates an alias so this is based on my testing only and would be worth some more testing.
Another complication is the case of non-aggregate queries where an alias is applied to an attribute. The previous code converted the FetchXML to a QueryExpression which would lose this alias, which would mean this column would then not be displayed correctly. I'm not sure what the reason is behind this conversion - I've removed it for now to always execute the raw FetchXML but happy to look again at this if there's some reason to do this conversion that I've missed.