New and Changed Modules for Lightning Web Components
New Module
The following module is now available.
- lightning/uiAppsApi
- This module includes one wire adapter, getNavItems. Use this wire adapter to get the navigation items (tabs) that the user has access to.
Changed Modules
The following modules have a new wire adapter or JavaScript function.
- lightning/uiObjectInfoApi
- The getObjectInfos wire adapter is new. Use
getObjectInfos to get metadata for multiple
objects. The response includes metadata describing fields, child relationships, record
type, and theme for each
object.
import { LightningElement, wire } from 'lwc'; import { getObjectInfos } from 'lightning/uiObjectInfoApi'; import ACCOUNT_OBJECT from '@salesforce/schema/Account'; import OPPORTUNITY_OBJECT from '@salesforce/schema/Opportunity'; export default class GetObjectInfosExample extends LightningElement { @wire(getObjectInfos, { objectApiNames: [ ACCOUNT_OBJECT, OPPORTUNITY_OBJECT ] }) propertyOrFunction; }
- lightning/uiRecordApi
- The getRecordNotifyChange() function is new. Call getRecordNotifyChange() to refresh the Lightning Data Service cache after you update a record outside of its mechanisms, such as via imperative Apex, Visualforce, or when you call User Interface API via a third-party framework. Lightning Data Service fetches record updates for the record IDs you specify and refreshes your Lightning Data Service cache, providing your wires with the latest record data.
-
import { LightningElement, wire } from 'lwc'; import { getRecord, getRecordNotifyChange } from 'lightning/uiRecordApi'; import apexUpdateRecord from '@salesforce/apex/Controller.apexUpdateRecord'; export default class NotifyRecordChangeExample extends LightningElement { @api recordId; // Wire a record. @wire(getRecord, { recordId: '$recordId', fields: ... }) record; async handler() { // Update the record via Apex. await apexUpdateRecord(this.recordId); // Notify LDS that you've changed the record outside its mechanisms. getRecordNotifyChange([{recordId: this.recordId}]); } }