Folks, I have a LWC data table displaying some aggregate data. It displays every column except for the 'count' column.
Here is my query:
SELECT Location_Share_Configuration__r.Name, Location__r.Name LocationName, Venue__r.Name VenueName,
Period__c, count(Name) Available
FROM Location_Share__c
GROUP BY Location__r.Name, Period__c,Venue__r.Name,Location_Share_Configuration__r.Name
The query returns the data i want.
My LWC and JS code:
<lightning-datatable
key-field="Name"
data={sharesData}
columns={columns}>
</lightning-datatable>
export default class MLSE_OppCatalog extends LightningElement {
@track columns = [
{ label: 'Package Name', fieldName: 'Name', type: 'text'},
{ label: 'Location', fieldName: 'LocationName', type: 'text' },
{ label: 'Venue', fieldName: 'VenueName', type: 'text' },
{ label: 'Period', fieldName: 'Period__c', type: 'text' },
{ label: 'Available', fieldName: 'Available', type: 'text' }
];
@wire(getRecord, { recordId: '$recordId', fields})
opportunity({ data, error }) {
//some code before then call refreshGrid
this.refreshGrid();
}
refreshGrid(){
getShares({ splitType: this.splitType, brands: this.brands, evtSplit: this.eventSplitType, boxSplit: this.boxSplitType, share: this.shareSize })
.then(result => {
console.log(result );
this.sharesData = result;
})
.catch(error => {
this.error = error;
});
}
}
Below is my result that doesn't display the total at the end.
I've changed the 'text' to 'number' for 'availability' in column definitions and this time it displays a 1 where there is a 10. I don't think it's supposed to do that.
label: 'Available', fieldName: 'Available', type: 'text'
Can you try changing the type tonumber
?