diff --git a/force-app/main/default/classes/SOQL.cls b/force-app/main/default/classes/SOQL.cls index 6de2295..7f89b7e 100644 --- a/force-app/main/default/classes/SOQL.cls +++ b/force-app/main/default/classes/SOQL.cls @@ -728,7 +728,6 @@ public virtual inherited sharing class SOQL implements Queryable { private class QFields implements QueryClause { private Set fields = new Set(); private Set aggregatedFields = new Set(); - private Boolean hasCount = false; public void count() { count('COUNT()'); @@ -744,7 +743,6 @@ public virtual inherited sharing class SOQL implements Queryable { } private void count(String count) { - this.hasCount = true; withAggregatedField(count); fields.add(count); } @@ -797,7 +795,7 @@ public virtual inherited sharing class SOQL implements Queryable { } public Boolean hasCount() { - return hasCount; + return !aggregatedFields.isEmpty(); } public override String toString() {