Use lineitemsSOQL for multiple filtered related lists
Avoid shared filter behavior when one template contains more than one filtered related list.
Use lineitemsSOQL when a template includes more than one filtered version of the same related list.
Legacy <lineitems> blocks can apply one filter to both lists. lineitemsSOQL keeps each filter separate.
Problem
If one template contains multiple legacy related lists with different <where> clauses, both lists can render using the same filter.
This usually appears when you split one related list into separate sections, such as:
hardware products
service products
open items and closed items
Solution
Convert each legacy related list to its own <lineitemsSOQL> block.
Each block uses its own SOQL query, so each list keeps its own WHERE, ORDER BY, and LIMIT logic.
What to change
Example conversion
This legacy related list filters Opportunity Products by product family.
Convert it to lineitemsSOQL like this:
If you need a second list, create a second lineitemsSOQL block with its own WHERE clause.
For example, a second block could filter Family = 'Services' without affecting the first block.
Key detail
opportunitylineitems is a relationship name. OpportunityLineItem is the object name.
That object name belongs in the SOQL FROM clause.
Keep going
Last updated
Was this helpful?

