function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Display cases using LWC

I am trying to display cases based on the Account selection 

  <h6> Showing Cases based on Account Selected on this Value Plan</h6>
  <lightning-datatable data={data} columns={columns} key-field="Id">
import { LightningElement ,api,wire,track} from 'lwc';
import getAllCase from '@salesforce/apex/GetAllCases.getAllCase';

export default class DatatableEx12 extends LightningElement {
    @track columns = [{
            label: 'Case Number',
            fieldName: 'CaseNumber',
            type: 'Auto Number',
            sortable: true
            label: 'Subject',
            fieldName: 'Subject',
            type: 'Text(255)'
        }, {
            label: 'Status',
            fieldName: 'Status',
            type: 'Picklist'
        }, {
            label: 'Case Type',
            fieldName: 'Type',
            type: 'Picklist'
    @track error;
    @track data ;
    @api recordId;
    wiredOpps({error,data}) {
        if (data) {
   = data;
            console.log(JSON.stringify(data, null, '\t'));
        } else if (error) {
            this.error = error;
public with sharing class GetAllCases {   

    public static List<Case> getAllCase(String accountId) {
    this.acnt= (Account)controller.getRecord();

     Account acc = [Select id FROM Account where id =];

Barbara Campbell 3Barbara Campbell 3