You need to sign in to do that
Don't have an account?
SSK9
Apex Error:CustomerPricingModifier: System.LimitException: Too many SOQL queries: 101" error
Hi ,
Can you help me fix this error .CustomerPricingModifier: System.LimitException: Too many SOQL queries: 101" error
I get this error when Data is sent from Orcale to Salesforce via Mulesoft.
trigger CustomerPricingModifier on Customer_Pricing_Modifiers__c (after insert)
{
for(Customer_Pricing_Modifiers__c cp:Trigger.New){
integer i=[Select count() from Customer_Pricing_Modifiers__c WHERE External_Unique_ID__c=:cp.External_Unique_ID__c];
if(i>1){
CustomerDupTriggHandler.DuplicateHandler(trigger.new);
}
}
}
Can you help me fix this error .CustomerPricingModifier: System.LimitException: Too many SOQL queries: 101" error
I get this error when Data is sent from Orcale to Salesforce via Mulesoft.
trigger CustomerPricingModifier on Customer_Pricing_Modifiers__c (after insert)
{
for(Customer_Pricing_Modifiers__c cp:Trigger.New){
integer i=[Select count() from Customer_Pricing_Modifiers__c WHERE External_Unique_ID__c=:cp.External_Unique_ID__c];
if(i>1){
CustomerDupTriggHandler.DuplicateHandler(trigger.new);
}
}
}
You should not have a query inside a for loop. You are querying 2 times for each trigger records. try the following code