Salesforce Fact #275 | Import field with namespace in LWC
Suppose we have to import multiple fields in LWC of a standard object. Now some of the fields are standard and some are custom fields. The custom fields have a namespace at the start. So, if we try to import them from '@salesforce/schema' it will throw error.
As a workaround, we can refer the custom field Apinames statically and get their value from getRecord.
In this example, we have a custom field AutoNum__c on Account which is having a namespace. So, we have referred the field statically before retrieving its value.
Attached are the screenshots.
Comments
Post a Comment