lwc icon indicating copy to clipboard operation
lwc copied to clipboard

unable to import RecordType.DeveloperName from @salesforce/schema

Open mateuszzw opened this issue 2 years ago • 2 comments

Description

@Salesforce/Schema behaves inconsistently - it's possible to import standard and custom sObject's fields, e.g. Contact.Name, but if there's an import for RecordType.DeveloperName there's an error on the deployment attempt.

Steps to Reproduce

Create LWC component and include the following import in the controller:

import RECORD_TYPE_DEVELOPER_NAME from '@salesforce/schema/RecordType.DeveloperName';

Expected Results

successful import

Actual Results

Error:(1, 1) FIELD_INTEGRITY_EXCEPTION - Invalid reference RecordType.DeveloperName of type sobjectField in file example.js: Source

Browsers Affected

not applicable

Version

  • latest

mateuszzw avatar Apr 27 '22 18:04 mateuszzw

Facing the same issue, but importing CurrencyIsoCode from CustomSObject on multy-currency ORG.

EugeneMarshin avatar Jun 28 '22 15:06 EugeneMarshin

Thanks for raising this issue @mateuszzw and @EugeneMarshin. Sorry for the delayed response. We are having some trouble reproducing the issue you are facing. Could you please share a minimal SFDX project or detailed steps to reproduce this issue in a fresh dev org?

pmdartus avatar Jun 29 '22 09:06 pmdartus

We are getting the same issue Error:(1, 1) FIELD_INTEGRITY_EXCEPTION - Invalid reference CRS_WorkItem__c.RecordType.DeveloperName of type sobjectField in file wiDeferralAction.js: Source

CRS_WorkItem__c is a custom sObject.

alz-gg avatar Dec 01 '22 11:12 alz-gg

@alz-gg Could you please share a minimal repro?

pmdartus avatar Dec 05 '22 10:12 pmdartus