You need to sign in to do that
Don't have an account?

Too many SOQL queries: 21
hi,
in my application object A have SFN Number of type input text field and object B have SFN Number which is looking over to objectA SFN Number.i am comparing the Object B SFN Number with ID of object A.At the time of saving the record the following error is raising
Too many SOQL queries: 21
trigger summation on chiranjeevi__Obj_A__c (before insert,before update) {
Double objBtotal = 0;
List<chiranjeevi__Obj_A__c> objAlist=new List<chiranjeevi__Obj_A__c>();
List<chiranjeevi__Obj_B__c> objBlist=new List<chiranjeevi__Obj_B__c>();
chiranjeevi__Obj_A__c[] id=[select ID from chiranjeevi__Obj_A__c];
for(chiranjeevi__Obj_A__c b : id)
{
objBlist=[SELECT chiranjeevi__Amount__c,chiranjeevi__SFN_Number__c FROM chiranjeevi__Obj_B__c Where chiranjeevi__SFN_Number__c =: b.id];
}
for (chiranjeevi__Obj_A__c objA : Trigger.new)
{
for (chiranjeevi__Obj_B__c objB : objBlist)
objBtotal += objB.chiranjeevi__Amount__c;
{
objA.chiranjeevi__Total_Amount__c=objBtotal;
}
}
}
If i check with particular id name it is working poperly.
If any one knows plz help me.
Thanks in advance,
Anu..
