0

I am trying to make an lwc component for a specific 3rd party ( app exchange app ) so that they could easily add our components in their app from UI builder.

For that I am using targets and targetconfig metadata in the .js-meta.xml file.

Following is my code:

<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>49.0</apiVersion>
    <isExposed>true</isExposed>

<targets>
    <target>lightning__RecordPage</target>
</targets>

<targetConfigs>
    <targetConfig targets="lightning__RecordPage">
        <objects>
            <object>third_party_Custom_Object__c</object>
        </objects>
    </targetConfig>
</targetConfigs>
When I try to deploy to my developer edition then it failed with following error:
Invalid reference third_party_Custom_Object__c of type sobjectClass in file MyProjectTabs.js-meta.xml

Please tell me if this is possible to creaet this type of dependency.

​​​​​​​I really appreciate for any response.

Thanks in advance

2
  • 2
    Is the custom object managed? If so, did you specify it with the correct namespace prefix? Is the owning managed package installed in the org where you are deploying?
    – David Reed
    Commented Oct 11, 2020 at 15:21
  • @DavidReed Yes that custom object is managed. And that managed package is paid. And it is not installed on my developer edition ( where I am deploying ) and I don't want to install that 3rd party manage package in my developer edition. Commented Oct 11, 2020 at 15:29

1 Answer 1

3

Per your comment:

that custom object is managed. And that managed package is paid. And it is not installed on my developer edition ( where I am deploying ) and I don't want to install that 3rd party manage package in my developer edition

That won't work. You must refer to this custom object using its fully-qualified API name, including the namespace prefix of the managed package, and the managed package must be installed in the target org. You will not be able to deploy your metadata if you fail to do so.

If you don't want the hassle of installing the managed package in your Developer Edition and later perhaps removing it, consider using a scratch org instead.

3
  • Actually we have an Enterprise org. And we already have paid for that third party app to install that third party package. So we don't want to buy another paid license just for development in Developer edition. About using scratch org, I have few questions: Can I deploy to scratch org without this dependency issue? And Can I create manage package version and publish from scratch org? If I cannot publish manage package from scratch org then what is the solution? Because after development and testing we want to publish our package and I guess we can publish only from Developer edition. Commented Oct 11, 2020 at 15:41
  • 1
    If you are creating a first-generation managed package, you must build in a Developer Edition org. You cannot deploy to any species of org without having the managed package installed in that org, full stop.
    – David Reed
    Commented Oct 11, 2020 at 21:13
  • 1
    I honestly can't recall which species of licensing are and are not enforced in a Developer Edition Salesforce orgs. Perhaps someone else can chime in!
    – David Reed
    Commented Oct 11, 2020 at 21:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .