Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Unable to use @import with custom objects #15

Open
kbuckles-sfdc opened this issue Oct 31, 2019 · 14 comments
Open

Unable to use @import with custom objects #15

kbuckles-sfdc opened this issue Oct 31, 2019 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@kbuckles-sfdc
Copy link

kbuckles-sfdc commented Oct 31, 2019

With DX-Code-Companion enabled, I am unable to use @import with a custom object. I get the following error:

FIELD_INTEGRITY_EXCEPTION: Invalid reference Custom_Object__c.Field__c of type sobjectField

If I disable DX-Code-Companion, file saves just fine and I can deploy manually and LWC works fine.

Any work around to this?

@msrivastav13
Copy link
Owner

@kbuckles-sfdc Can you provide more details around here ? Please share a simple example where i can reproduce this .

Also share the api version in your metadata xml file . I fear this is salesforce has issues with tooling api.

@kbuckles-sfdc
Copy link
Author

kbuckles-sfdc commented Oct 31, 2019

I am using: <apiVersion>46.0</apiVersion>

Steps to reproduce:

  • Create a custom object with some custom fields
  • Create a new LWC
  • In your LWC .js file, try to import a custom field from your custom object: import SOME_FIELD from '@salesforce/schema/Some_Object__c.Some_Field__c';
  • Try to save your file, which then deploys the changes to your org, and you will see the error.

@msrivastav13
Copy link
Owner

@kbuckles-sfdc Sorry for the delayed response on this. This looks like an issue with the Tooling api in salesforce. I will open a case on this and keep you updated.

@jprichter
Copy link

@msrivastav13 I just ran into this same error using a custom field on a standard object (Contact). Looks like ForceCode ran into this or a similar issue here.

Any plans to address this in the near future?

@msrivastav13
Copy link
Owner

@jprichter The core issue is in the tooling api of LWC. I will raise it internally at salesforce and see what can be done for this. The Salesforce LWC extension using metadata api for it and it works with it. For now only workaround is use Salesforce Official LWC Extension.

@jprichter
Copy link

Thanks for clarifying. Is this Tooling API issue posted publicly anywhere like a known issue?

@msrivastav13 msrivastav13 self-assigned this Apr 18, 2020
@msrivastav13 msrivastav13 added the bug Something isn't working label Apr 18, 2020
@oagostinho
Copy link

Hi

I have the same problem when I am using a custom field in an standard Object such as:
import QLI_SERVICE_TYPE_NAME_FIELD from "@salesforce/schema/QuoteLineItem.Service_Type__c";

Any News?
Thanks

@msrivastav13
Copy link
Owner

Hello,

The work is logged with metadata and tooling teams and looks like it is de prioritized at this point!

It is recommended to use mdapi for now!

@tielinglang
Copy link

Hi

Any News about this situation?

Thanks

@msrivastav13
Copy link
Owner

@tielinglang It's still in the backlog! You can use the official salesforce extension to push that uses metadata API than tooling API!

@khanaaa-mfcgd
Copy link

khanaaa-mfcgd commented Apr 22, 2021

Hello @msrivastav13 I am having this issue even using the the official Salesforce LWC extension. Do you know why it is deprioritized ? Can you please expedite it ?

image

@msrivastav13
Copy link
Owner

Please raise in the official repo for the extension!

Not here!

@khanaaa-mfcgd
Copy link

@msrivastav13
Where is the official repo ?

@msrivastav13
Copy link
Owner

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants