You need to sign in to do that
Don't have an account?
Sergio Mac Intosh
LWC Apex Query Doesnt work
I have issues with a simple call to get records in Apex controller. I cant get the data in my LWC. The Apex Controller is being called correctly and the response is also correct.
import { LightningElement, wire } from 'lwc'; import LabelChooseTarget from '@salesforce/label/c.Choose_a_target'; import LabelCreateNewLabel from '@salesforce/label/c.Create_New'; import FIELD from '@salesforce/schema/Target_Configuration__c.Name'; import getAllConfigurations from '@salesforce/apex/ConfigurationController.getAllConfigurations'; const COLUMS = [ {label : 'Name', fieldName : FIELD.fieldApiName, type: 'text'} ]; export default class ConfigurationSelector extends LightningElement { column = COLUMS label = { LabelChooseTarget }; @wire(getAllConfigurations) configurations; }
<template> <lightning-card icon-name="custom:custom83" title={label.LabelChooseTarget}> <template if:true={configurations.data}> <lightning-datatable key-field="Id" data={configurations.data} colums={colums}> </lightning-datatable> </template> </lightning-card> </template>
<lightning-datatable
key-field="Id"
data={configurations.data}
columns={colums}>
1 </lightning-datatable