Play Games

Search This Blog

Thursday, April 28, 2022

Single SOQL query to query Quote and quote line items together in salesforce - Salesforce Globe For You

Solution: Use the following SOQL query.

SELECT id,Name,QuoteNumber,Status,(Select id,LineNumber,ServiceDate,QuoteId,Quantity from QuoteLineItems) from Quote

Example: Run the following piece of code in developer console.

List<Quote> lstQuote = new List<Quote>();

lstQuote = [SELECT id,Name,QuoteNumber,Status,(Select id,LineNumber,ServiceDate,QuoteId,Quantity from QuoteLineItems) from Quote];

system.debug('List of Quotes: '+lstQuote);

Output:



No comments:

Post a Comment