I am trying to deploy around 80 Components which include Apex Class,Trigger and Visualforce Pages. But it is failing due to below exception,
MyTrigger: execution of BeforeInsert caused by: System.QueryException: Aggregate query does not support queryMore(), use LIMIT to restrict the results to a single batch Trigg...
All test classes are run as a part of deployement process hence few of the test classes are making this trigger fire causing error. As its a change set deployment error, could not get the complete error statement. Also my trigger includes below code.
if(trigger.isBefore & trigger.isInsert) {
for(AggregateResult ar : [select ABC__c, Name, max(Revision__c) maxRev from XYZ__c
where ABC__c in :oppMap.keySet()
group by ABC__c, Name order by ABC__c, Name]) {
decimal maxRev = Integer.valueOf(ar.get('maxRev'));
string oppAppKey = String.valueOf(ar.get('ABC__c')) + String.valueOf(ar.get('Name'));
lrMap.put(oppAppKey, maxRev);
}
}
Let me know how to fix this. Should i try using limit or is there any other solution?