When one has a Process Builder that gets invoked when an Opportunity is created and is further calling an Autolaunched flow to pass the opportunity Id. This flow is creating a Quote with Quote.OpportunityId for the newly created Opportunity and updating the Opportunity.SyncedQuoteId to the created Quote.
In this scenario, Quote is getting created and Opportunity.SyncedQuoteId also has the Quote Id, but Quote.IsSyncing field is "False" and Quote UI shows "Start Sync" button.
On clicking "Start Sync", there is nothing to sync.
We get message: "Quote TestFromPB is already synced with this opportunity. An opportunity can be synced with only one quote. If you continue, TestFromPB won’t sync."
The quote doesn’t have any line items, and the opportunity doesn’t have any products.
After a quote is synced, opportunity products and quote line items are updated automatically.
Quote.IsSyncing is "False"
Cause:
When Quote is created it is in unsync state and hence the Opportunity.SyncedQuoteId should be null.
In this case, when Opportunity Insert, Quote Insert, and Opportunity Update happen in Single Transaction, the flow action sets Opportunity.SyncedQuoteId to the created Quote Id and hence the process detects no change in the Quote Id while syncing and hence does not sync.
The Opportunity is saved in a parent transaction and the same transaction is not ended. In the same transaction, the Quote is inserted and the Opportunity is updated. The issue here is the Opportunity entity Insertion and the Opportunity entity save with updated SyncedQuoteId are in the same transaction. Since it is a recursive save, the sync is not triggered during the update action. The Quote Id is anyways updated on the opportunity.
During the start sync process, the quote Id should be different from the SyncedQuoteId field. If it is different, the quote is synced else it is ignored.
If a new quote is created manually and synced, synced Quote Id differs from this and hence the sync is completed successfully.
As per the Document Flows in Transactions
Flow's transaction ends when a pause element is executed.
The solution is to separate the transaction.
Create a Schedule Action as "after 0 hours of CreatedDate" in the Process Builder before calling the flow to separate the transaction.
How Does Salesforce Process Scheduled Actions?
000391126

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.