6

Hello and thank you for taking the time to read my question, this may be a really stupid question but I have been banging my head all morning into finding the answer. I looked at the Quote Schema as well as the Developer docs Quote Doc

I was not able to find a way to create the 'push' of the Sync button. As well when I try to change the checkbox to True in code

Quote testQuote = new Quote(
                        name= 'JFTestQuote',Agreement_Term__c = '12 Months', Payment_Terms__c = '1005 with Purchase Order',
                        OpportunityId = testOpp.Id, IsSyncing = TRUE
                        );

I get an error stating : Field is not writeable.

I need to have my quote as synced in order to test my trigger, as there may be many quotes in the opportunity but only the synced would be of importance.

Any thoughts? Thanks again!

7

Instead of marking the sync at the quote level you'll need to mark it at the opportunity level via the Opportunity.SyncedQuoteId field. After doing this the Quote.IsSyncing field will be true.

3

This blog post (http://blog.softwareallies.com/2010/08/salesfoce-syncing-quote-in-apex.html) explains what triggers the syncing to happen.

  • Thank you Mike, the blog had everything I was looking for. – jnoel10 Feb 19 '13 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.