Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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!

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
Thank you very much for this information Ralph. –  jnoel10 Feb 19 '13 at 15:55
    
@jnoel10 happy to help, if that answered you're question could you accept my answer? –  Ralph Feb 19 '13 at 15:56
add comment

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

share|improve this answer
    
Thank you Mike, the blog had everything I was looking for. –  jnoel10 Feb 19 '13 at 15:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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