You need to sign in to do that
Don't have an account?
d.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;
}
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;
}
Refer to the below link,
https://developer.salesforce.com/forums/ForumsMain?id=906F00000009ofNIAQ
Regards,
Ashish