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
Doug HeindelDoug Heindel 

Quote Trigger that auto-syncs the "Accepted" Quote to the Oppotunity

I am using the following trigger to update the Opportunity Stage when a Quote is "Accepted". 

 

 

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 - Not Live';
update opp;
}
}

 

 

Anyone know how I could also make the "Accepted" quote also sync to the opportunity without having to manually press the Start Sync?

 

Thanks in advance for any help here.