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

Test Class For Task Trigeer
HI,
Can anyone give me test class for my below trigger, i can't understand how to start the test class for my trigger
Can anyone give me test class for my below trigger, i can't understand how to start the test class for my trigger
trigger updatequotestatus on task (after insert, after update){ set<Id> quoteIds = new set<Id>(); list<quote__c> quotes = new list<quote__c>(); for(task t:trigger.new){ if(t.whatId!=null){ if((t.whatid.getsobjecttype()==quote__c.sobjecttype)){ quoteIds.add(t.whatId); } } } for(quote__c q:[select StageName__c from quote__c where Id IN : quoteIds]){ quote__c qt = new quote__c(); qt.Id = q.Id; qt.StageName__c = 'Proposal Sent'; quotes.add(qt); } if(quotes.size()>0){ update quotes; } }
If this helps,please mark it as best answer to help others :)