You need to sign in to do that
Don't have an account?
yarram
Urgent:: System.LimitException: Too many SOQL queries: 101
Hi All,
i am getting too many soql limt exceed error when my below class executed. Please help me on this. This is very urgent.
public class ProjectUtil{
public static void beUpdate(List<OpportunityLineItem > listOLIList){
Project_Assay__c PrjAssay;
for (OpportunityLineItem OppLI: listOLIList) {
PrjAssay=[select id,name,Assay_Number__c,Sales_Price__c, Study_Number__c,OppAssay__c,
from Project_Assay__c where OppAssay__c=:OppLI.OppAssay__c];
PrjAssay.Assay_Number__c=OppLI.ProductCode;
PrjAssay.Quantity__c=OppLI.Quantity;
PrjAssay.Study_Number__c=OppLI.Study_Number__c;
PrjAssay.OppAssay__c=OppLI.OppAssay__c;
PrjAssay.Sales_Price__c=OppLI.UnitPrice;
}
update PrjAssay;
}
}
Thanks,
Yarram
i am getting too many soql limt exceed error when my below class executed. Please help me on this. This is very urgent.
public class ProjectUtil{
public static void beUpdate(List<OpportunityLineItem > listOLIList){
Project_Assay__c PrjAssay;
for (OpportunityLineItem OppLI: listOLIList) {
PrjAssay=[select id,name,Assay_Number__c,Sales_Price__c, Study_Number__c,OppAssay__c,
from Project_Assay__c where OppAssay__c=:OppLI.OppAssay__c];
PrjAssay.Assay_Number__c=OppLI.ProductCode;
PrjAssay.Quantity__c=OppLI.Quantity;
PrjAssay.Study_Number__c=OppLI.Study_Number__c;
PrjAssay.OppAssay__c=OppLI.OppAssay__c;
PrjAssay.Sales_Price__c=OppLI.UnitPrice;
}
update PrjAssay;
}
}
Thanks,
Yarram
Thanks,
yarram.
Try this code it must solve your problem
pls let me know if it works.
Thanks for your reply,
is Second FOR loop correct? you are assigning the ProjectAssay list to Opp.Lineitem object.
please give me the some clarity about this.
Thanks,
yarram.