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

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;
}
Ashish_SFDCAshish_SFDC
Hi , 


Refer to the below link, 

https://developer.salesforce.com/forums/ForumsMain?id=906F00000009ofNIAQ


Regards,
Ashish