01 Sep DISABLE QUOTE SYNC AFTER OPPORTUNITY IS CLOSED
As part of our standard quote generation process, we sync our primary quote with the Opportunity. Once the deal is won or lost, the quote sync is still active that means any changes made to the quote even after the Opportunity is Closed Won will be pushed to the related Opportunity. This page explains how we can stop the automatic synchronisation between a Quote and an Opportunity if you are using the standard Salesforce Quotes.
Setting up a Quote Sync
Once you have created the Quote related to an Opportunity and clicked on “Start Sync” button on Quote record, you’ll notice that the primary quote is populated on the “Synced Quote” field on the Opportunity record.
Solution to our problem is hidden in removing this value from this field but Salesforce does not allow to remove this value in a synchronous context i.e you cannot remove this value directly using a process builder OR an apex trigger. The workaround is you call a future method from the apex trigger add a schedulable task to a process builder.
Use Process Builder to remove Synced Quote value
Step 1. Create a process builder on the Opportunity object. While selecting the object set these Values:
Start the process = when a record is created or edited
Step 2. Add a condition so it only executes when the Opportunity stage changes to Closed Won. In the Advanced section, make sure to check the ” Do you want to execute the actions only when specified changes are made to the record? ” option otherwise we won’t be able to create the scheduled action.
Step 3. In the scheduled Actions, set the time for action to Execute as
0 Hours after Last Modified Date
and finally, add an action to Set the quote ID field to null.