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
m_roarkm_roark 

Using Quotes in Apex code - Any resources available?

I'm building a custom wizard for new Opportunities which will also build an initial Quote.  I'm trying to figure out how to leverage the platform's native ability to create Quote Line Items from the parent Opportunity, and I'm a bit stumped. Creating a new Quote doesn't seem to do it automatically. 

 

I looked through the usual resources, the Apex language reference and the Web Services reference, and I am unable to find any documentation on what methods are available on the Quotes object.  Code completion isn't working for me in Eclipse on the Quote object, so that doesn't work either.

 

I've searched this site, and even turned to Google.  Unfortunately 'quote' is a very generic search term, so it hasn't been very helpful.   If anyone can point me to a good resource primer on the Quote object as it exists in Apex, I would be most appreciative.

m_roarkm_roark

I updated to the most recent version of the Eclipse plugin, and now code completion is working for the Quote object.

 

However, I still am unable to find out if it is possible to use a method in Apex to automatically create the Quote Line Items when the Quote is created under an existing Opportunity with Opportunity Products.

 

Mauricio OliveiraMauricio Oliveira

I got stuck on the same problem, I want to reproduce the Salesforce interface "New Quote" which creates a new quote copying the Opportunity Products related to the quote's opportunity, but I can't find a way to trigger that call by an apex test.