function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
d.tejdeep@nicomatic.ind.tejdeep@nicomatic.in 

Error while deploying the trigger urgent solution needed

Error while deploying
Trigger while deploying i am getting the error :

trigger orderreceived on Quote__c (after update,after insert) {
Profile pr = [select id from Profile where name='USA User'];
list<task> ta=new list<task>();
Set<id> QuoteId = new Set<id>();
    for(Quote__c q:Trigger.new){
    if(UserInfo.getProfileId()==pr.id){
     if (q.Order_Received__c!= Null && q.Order_Received__c == true )
        QuoteId.add(q.Id);
    }
    }
list<task> tasklist=[SELECT Id,whatId,whoid FROM Task where whatid=:Quoteid ];
for (Integer i = 0; i < tasklist.size(); i++) {
tasklist[i].status='completed';
}
update tasklist;
}


i had used many ways like

way 1:

list<task> tasklist=[SELECT Id,whatId,whoid FROM Task where whatid=:Quoteid ];
for (task t: tasklist){
t.status='completed';
tasklist.add(t);
}
update tasklist;
}

way2:
list<task> ta=new list<task>();
list<task> tasklist=[SELECT Id,whatId,whoid FROM Task where whatid=:Quoteid ];
for (task t: tasklist){
t.status='completed';
ta.add(t);
}
update ta;
}

I am getting error as while deploying as s

TestQuotelineitem_France_Edit.testMethod1() Class 413  Failure Message: "System.LimitException: Too many SOQL queries: 101", Failure Stack Trace: "Class.Quotelineitem_France_Edit.InfoWithoutAccNum: line 413, column 1 Class.Quotelineitem_France_Edit.france: line 390, column 1 Class.TestQuotelineitem_France_Edit.testMethod1: line 77, column 1"
TestQuotelineitem_IBC.testMethod1() Class 6  Failure Message: "System.LimitException: Too many SOQL queries: 101", Failure Stack Trace: "Class.asyncApex.processAccounts: line 6, column 1 Trigger.quotepotential: line 12, column 1"
Ashish_SFDCAshish_SFDC
Hi Tejdeep, 


Try adding a list instead of a single SObject on th e below line, 

Profile pr = [select id from Profile where name='USA User'];

If that does not solve, reply with the line in this code is the error throwing?


Regards,
Ashish
d.tejdeep@nicomatic.ind.tejdeep@nicomatic.in
I Was error Came from other test class .Thankyou for the reply