I am pretty new to using lwc and I was using the uiListApi to query records for the workorder object. A couple days ago the query was working just fine and I was able to query the records based on the selected listview on my scratch org but now I don't seem to get any records at all. I am not really sure what the problem is as I haven't made any changes to the code in days. The namespace is just the current namespace I am working with, not sure if I need to add the namespace I am working to the listViewName.
import { LightningElement, wire} from 'lwc';
import {getListUi} from 'lightning/uiListApi';
import WORKORDER_OBJECT from '@salesforce/schema/Workorder__c'
import listViews from '@salesforce/apex/ServiceCalendarController.listValues'
import { refreshApex } from '@salesforce/apex';
export default class CalendarFilter extends LightningElement {
listViewName = 'NAMESPACE__All';
queriedRecords;
@wire(getListUi, {
objectApiName: WORKORDER_OBJECT,
listViewApiName: '$listViewName'
})
wiredlistView
({
error,
data
})
{
if (data)
{
this.queriedRecords = data.records.records;
this.dispatchEvent(new CustomEvent('valuechange',
{
detail:
{
data: this.queriedRecords
}
}));
}
}
handleChange(event)
{
refreshApex(this.wiredlistView);
this.listViewName = 'NAMESPACE__' + event.detail.value;
}
}