trigger quotepotential on Quote_line_item__c (after insert,after update) {
list<Quote__c> qu=new list<Quote__c>();
for(Quote_Line_Item__c Qli:trigger.new){
Quote__c quotepotential=new Quote__c();
quotepotential.id=qli.Quote1__c; AggregateResult[]
groupedResults=[Select Quote1__c, SUM(max_batch__c)ba From Quote_Line_Item__c
Where Quote1__c =: quotepotential.id group by Quote1__c ];
for (AggregateResult ar : groupedResults) {
quotepotential.potential__c= (Decimal)ar.get('ba');
Qu.add(quotepotential);
}
}
update Qu;
}
This is the trigger which I wrote. It is showing errors while deploying in production. I have attached the image of the errors page. It is throwing from old test cases which was already in production.
Please help me in optimizing the code to deploy in production