I'm trying to display related list of OpportunityLineItem in a LWC which is used in recordDetail page in Community for Opportunity. However I encounter this error (note I log in as System Administrator user, so I can access to all records):

{"status":400,"body":{"message":"The related lists UI API currently does not support this related list","statusCode":400,"errorCode":"INVALID_TYPE"},"headers":{},"ok":false,"statusText":"Bad Request","errorType":"fetchResponse"}

@wire(getRelatedListRecords, {
    parentRecordId: '0068b00001Q1bo4AAB',
    relatedListId: 'OpportunityLineItems',
    fields: ['OpportunityLineItem.Id','OpportunityLineItem.UnitPrice','OpportunityLineItem.ProductCode'],
    sortBy: ['OpportunityItemLine.ProductCode']
})lineItemsInfo({error, data}) {
        this.records = data.records;
    } else if(error){

Any suggestion, please! Thanks!

1 Answer 1


Salesforce doesn't support all the standard objects for ui*api, and OpportunityLineItem is one of them. I faced smiler issue with this object with uiRecordApi.

For your current requirement, you need to call separate Apex call via Imperative or Wire to fetch the records of this object.

Reference https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_supported_objects

You must log in to answer this question.

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