Leveraging Object and Field References in LWC Wire Adapters
When utilizing a wire adapter, it is strongly advised to import references to fields and objects in a lightning/ui*Api module. Salesforce verifies the validity of the fields and objects, prevents their removal, and propagates any rename modifications into your component's source code. It also ensures that dependent objects and fields are included in change sets and packages. If references to objects and fields are imported, your code will still work even if their names change in salesforce. Lightning Web Components supports the import of references to standard objects, as well as the import of references to custom objects (__c) only. To import a reference to an object, use this syntax . import objectName from "@salesforce/schema/object"; import objectName from "@salesforce/schema/namespace__object"; import FIELD_NAME from "@salesforce/schema/object.field"; Example: import ACCOUNT_OBJECT from "@salesforce/schema/Account"; import ACCOUNT_NAME_...