Suppose I have query like
var countAlias = "entity_count";
var query = FormattableString.Invariant($@"
<fetch distinct='false' aggregate='true'>
<entity name='{entityName}'>
<attribute name='createdon' alias='{countAlias}' aggregate='count'/>
</entity>
</fetch>");
var response = organizationService.RetrieveMultiple(new FetchExpression(query));
var entity = response.Entities.First();
var count = (int)((AliasedValue)entity[countAlias]).Value;
This works nicely unless there is more than 50K records - then it hits the aggregation limit. Is there a way how to query total count of entities in system without paging ?