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
John StanczakJohn Stanczak 

How To retrieve field values from all Quote Line Items of a given Quote using SOQL

I'm attempting to write a SOQL Query that will pull a custom field value Category_ID__c from all of a quotes line items and then render them on a template. However The Query only seems to return the value from line item.

Here is the Query:
SELECT Category_ID__c
FROM quotelineitem
WHERE quote.id='{{!quote.id}}'


and here is the list of lineitems I am querying from: User-added image 
I'd like for the Query to return all of the Category IDs for every line item.

so far this is all I get: 


Can someone tell me what I am doing wrong here? Thanks.
AbhishekAbhishek (Salesforce Developers) 
Hi John,

Try the suggestions as mentioned in the below blogs,

https://salesforce.stackexchange.com/questions/157148/soql-query-to-retrieve-quote-line-item-records-from-quote-record

https://success.salesforce.com/answers?id=9063A000000iZhfQAE

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks.