I need to fetch all records from metadata. But I am facing error like below.

yc {status: 404, body: {…}, headers: {…}}
errorCode: "NOT_FOUND"
message: "The requested resource does not exist"
statusCode: 404
__proto__: Object
headers: {}
status: 404
ok: (...)
statusText: (...)
__proto__: Object

Note: Unsure what should be the name of the listViewApiName. How to find the list view api name for a metadata?

import {getListUi} from 'lightning/uiListApi';  
import taskMetadata_OBJECT from '@salesforce/schema/SR_Task_Library__mdt'; 
@wire(getListUi, {
    objectApiName: taskMetadata_OBJECT,
    listViewApiName: 'listOfAllTaskRecords'
  wiredTaskLists ({error, data}) {
      if (data) {
          console.log(`getListUI ${data}`)
      } else if (error) {

1 Answer 1


I don't think you can use getListUi for custom metadata. The closest I got was:

message: INVALID_FIELD: SELECT LastModifiedDate, CreatedDate, Id ^ ERROR at Row:1:Column:8 No such column 'LastModifiedDate' on entity 'myns__mycmt__mdt'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

I got this error when calling:


(Note: this is in my dev org that has a namespace). You'll probably need to use Apex to query the list views.

You must log in to answer this question.

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