Skip to content

Instantly share code, notes, and snippets.

@sohalloran
Created June 17, 2020 14:58
Show Gist options
  • Save sohalloran/5be1daf94a2d4e8fcd92df2cf6988e62 to your computer and use it in GitHub Desktop.
Save sohalloran/5be1daf94a2d4e8fcd92df2cf6988e62 to your computer and use it in GitHub Desktop.
/* APEX */
public class AccountCount {
@AuraEnabled(cacheable=true)
public static Integer getCount() {
return [select count() from Account];
}
}
/* LWC (JS) */
import { LightningElement, wire } from "lwc";
import getCount from "@salesforce/apex/AccountCount.getCount";
export default class RecordCount extends LightningElement {
@wire(getCount) count;
}
/* LWC (HTML) */
<template>
{count.data}
</template>
@vel32
Copy link

vel32 commented Dec 6, 2022

I have created an lwc for field dependencies can i get the record count of the selected the field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment