You need to sign in to do that
Don't have an account?
Vipin K 10
Test Class for trigger on Quote
Hi All,
Can someone help me with test class for this trigger?
trigger OptyStatusUpdate on Quote (after update) {
Set<String> quote=new Set<String>();
for(Quote q : Trigger.new)
{
if(q.Status=='Expired' || q.Status=='Rejected')
quote.add(q.OpportunityId);
}
for(Opportunity opp : [select id, StageName from Opportunity where id in: quote])
{
opp.StageName='Closed Lost';
update opp;
}
}
Thanks!!
Can someone help me with test class for this trigger?
trigger OptyStatusUpdate on Quote (after update) {
Set<String> quote=new Set<String>();
for(Quote q : Trigger.new)
{
if(q.Status=='Expired' || q.Status=='Rejected')
quote.add(q.OpportunityId);
}
for(Opportunity opp : [select id, StageName from Opportunity where id in: quote])
{
opp.StageName='Closed Lost';
update opp;
}
}
Thanks!!
Best Regards,
BALAJI
All Answers
You can try this - Pls, let me know if any further help is needed.
Thanks,
Sumit kumar Singh.
Please find below Test Class for your Trigger.
Let us know if that helps you.
Best Regards,
BALAJI
Please find below test class:
Hope this will solve you issue.
Thanks,
Gaurav
trigger OptyStatusUpdate on Quote (after update) {
Set<String> quote=new Set<String>();
for(Quote q : Trigger.new)
{
if(q.Status=='Expired' || q.Status=='Rejected')
quote.add(q.OpportunityId);
}
for(Opportunity opp : [select id, StageName from Opportunity where id in: quote])
{
opp.StageName='Closed Lost';
update opp;
}
}
===================================================================================
trigger QuoteUpdate on Quote (after update) {
Set<String> quote=new Set<String>();
for(Quote q : Trigger.new)
{
if(q.Status=='Accepted')
quote.add(q.OpportunityId);
}
for(Opportunity opp : [select id, StageName from Opportunity where id in: quote])
{
opp.StageName='Closed Won';
update opp;
}
}
Here you go, please find below trigger.
(Note: It is not tested.)
Let us know if that helps you.
Best Regards,
BALAJI
Best Regards,
BALAJI