1

I have been able to do all the steps in creating an unlocked package,

  1. Authenticate
  2. Retrieve
  3. Convert

But when I go to create the package, I am getting 2 types of errors:

  1. Component [force:relatedListSingleContainer] attribute [relatedListApiName]: Could not find related list [Opportunities_Lookup_Product__r] for entity [Product2]

^ for the first error what does this mean? The fields in scope were deployed by another unlocked package I deployed that my team created so Im assuming all the API Names should still be intact and need no update

  1. OpportunityLineItem-Opportunity Product Layout: In field: field - no CustomField named OpportunityLineItem.List_price_time_unit__c found

^ this error is driving me crazy because I have the custom field define in the Package.XML and it is getting retrieved in the Metadata API so why is it saying its not existing?

1 Answer 1

0

The fields in scope were deployed by another unlocked package I deployed that my team created so Im assuming all the API Names should still be intact and need no update

You don't need to change the API names (in most cases), but you do need to list this other Unlocked Package as a dependency of your package. When you do so, the platform will automatically deploy your dependency packages into the build org (the behind-the-scenes org you cannot see) where your package version is being created.

You would need to change how you reference that field by API name if your Unlocked Package has a different namespace. That doesn't appear to be the case here.

4
  • Thank you for your response @David Reed. I'll look into how to list the other unlocked package. Just for more context, I wasnt trying to reference fields from another unlocked package. What I was trying to articulate was that those fields got deployed into the source org from another package (just so I didnt have to manually recreate them). The weird thing is, other than that related list, its only complaining about 6 other fields that are defined in the XML but its still saying that it cannot find it.
    – andrew
    Dec 7, 2022 at 20:12
  • Overall, Im have this one unlocked package out there, and what I wanted to do was create another unlocked package that only had a subset of metadata from the original one as another offering to the client (a full package vs a lite package). So my thinking was to just deploy the unlocked package to another Developer org, tweak the XML file as needed, and then package up a lighter version of it- but as you read, Im running into these nuisances.
    – andrew
    Dec 7, 2022 at 20:14
  • Yeah, don't do that with an unlocked package. Unlocked packages are build from source only. Focus on your source tree, not an org - that's likely to just trip you up.
    – David Reed
    Dec 7, 2022 at 20:16
  • Your package cannot have references to custom components outside the package itself unless they're either (a) part of a dependency or (b) you're building an org-dependent package.
    – David Reed
    Dec 7, 2022 at 20:16

You must log in to answer this question.

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