Skip to content

Instantly share code, notes, and snippets.

@arun12209
Last active June 5, 2022 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun12209/821441336e9acab39fb15ea2a3da2ddb to your computer and use it in GitHub Desktop.
Save arun12209/821441336e9acab39fb15ea2a3da2ddb to your computer and use it in GitHub Desktop.
import { LightningElement,wire } from 'lwc';
import { getRelatedListsInfo } from 'lightning/uiRelatedListApi';
import ACCOUNT_OBJECT from '@salesforce/schema/Account';
export default class GetRelatedListInfo extends LightningElement {
error;
relatedLists;
@wire(getRelatedListsInfo, {
parentObjectApiName: ACCOUNT_OBJECT,
recordTypeId: '012E0000000RR6wIAG' //optional
})listInfo({ error, data }) {
if (data) {
this.relatedLists = data.relatedLists;
console.log('Data: '+ JSON.stringify(data));
this.error = undefined;
} else if (error) {
this.error = error;
this.relatedLists = undefined;
}
}
}
@arun12209
Copy link
Author

update

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