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

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow