Created
June 17, 2020 14:58
-
-
Save sohalloran/5be1daf94a2d4e8fcd92df2cf6988e62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have created an lwc for field dependencies can i get the record count of the selected the field