ThanksSudhirpublic with sharing class RenewalUtils {
public static String OppLineDisc(String QOppID, String Quoteid, String ProdCode) {
Decimal Disctot;
Opportunity ropp = [select Prior_Year_Opportunity__c from opportunity where id = :QOppID and recordtype.name = 'Renewal Opportunity'];
List<AggregateResult> Opplst = [select avg(Discount_Percent__c) totdisc
from OpportunityLineItem
where Opportunityid = :ropp.Prior_Year_Opportunity__c and
product2.productcode = :ProdCode
];
for (AggregateResult arOpplst : Opplst)
{
Disctot = ((Decimal)arOpplst.get('totdisc'));
}
system.debug(Disctot);
return string.valueof(Disctot);
}
public static String OppLineID(String QOppID, String Quoteid, String ProdCode) {
Opportunity ropp = [select Prior_Year_Opportunity__c from opportunity where id = :QOppID and recordtype.name = 'Renewal Opportunity'];
OpportunityLineItem Opplst = [select id
from OpportunityLineItem
where Opportunityid = :ropp.Prior_Year_Opportunity__c and
product2.productcode = :ProdCode limit 1
];
system.debug(Opplst.id);
return string.valueof(Opplst.id);
}
}
I ran your code I get message below mesage when I click on run class Please suggest me what might be the issue. Selected job is not yet complete.