Here is the scenario -

I am showing related orders in opportunity page layout by using related list lightning component.

Order is having two record types - say A and B.

In the Opportunity detail page, my requirement is to show only related orders having record type A.

I am not able to add filter based on order record type in Opportunity page layout. Any help is highly appreciated. Thanks.

4 Answers 4


There's three options available that I know of.

  • Use an existing, third party Lightning component that provides filtered related list functionality, such as this one from Salesforce Labs. (Disclaimer: not my component, and I haven't used it personally).
  • Write your own Lightning component that filters the related list appropriately.
  • Use a solution like Doug Ayers' Filter Related Lists Without Code to create synthetic related lists that are inherently filtered, and then utilize the standard Lightning related list component to show that filtered related list.
  • Thank you David. I am able to implement this with Doug Ayers' solution. Commented Apr 23, 2019 at 22:49

I am not able to add filter based on order record type in Opportunity page layout.

You won't be able to do so as the filters available are based on your current record. In your case you have child records that you are displaying in a related list and that you cannot utilize filtering here. You can only choose fields available on the record or related to the record.

On record pages, you can choose record fields or advanced fields, such as fields from related objects or from a global object like User.

Your options here to be able to display filtered related list are either to create a custom component or utilize this configurable solution (I know this works great as I had used this in one of my implementations) or utilize any third party solution if there are any available on app exchange.


If you are interested, you can look into the Aura Component on github project: https://github.com/CharlesGong-BOT/lightningRelatedListWithFilter It helps you do exactly what you need of filtering the related list with configuration on the lightning flexipage.

Otherwise the enhanced related list released in Summer 19 helps you to filter the records after you click on the view more button. https://releasenotes.docs.salesforce.com/en-us/summer19/release-notes/rn_lex_enhanced_related_lists.htm

I hope this helps!


You can use Dynamic related list from App builder where you can customize the related list based on the requirement forever

you can find the option for filter

watch this easily you will get your asnwer https://www.youtube.com/watch?v=goW_NxaYYcY

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .