2

Trying to convert a managed extension package to SFDX but I've run into a problem. I've converted the project using

sfdx force:mdapi:retrieve
and
sfdx force:mdapi:convert

If we say the base managed package has a namespace of BASE and the extension managed package a namespace of EXT.

I created a new scratch org with the namespace EXT and manually installed the base managed package (BASE).

All good so far.

Now the base managed packages has an object, say BASE__AnObject__c, and the extension managed package source code wants to add a field to it called say EXT__SomeField__c. The sfdx:force:mdapi:retrieve and convert generated an objects folder like following

objects/BASE__AnObject__c/BASE__AnObject__c.object-meta.xml
objects/BASE__AnObject__c/fields/SomeField__c.field-meta.xml

When I do an sfdx:force:source:push I get an error

Error force-app/main/default/objects/BASE__AnObject__c/BASE__AnObject__c.object-meta.xml Must specify a non-empty label for the CustomObject

That file currently contains

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <enableEnhancedLookup>false</enableEnhancedLookup>
</CustomObject>

I've tried filling out content in the object xml but it doesn't work and I think it's the wrong approach. I know for a standard object the that object-meta.xml wouldn't exist so I tried removing it but the sfdx force:source:push complains about it being missing.

Any suggestions on how to get the source to deploy would be appreciated.

0

You should be able to achieve this if you

  • Delete the .object-meta.xml file.
  • Create a new scratch org (I suspect source tracking is simply confused with your current one).
  • Ensure that the new scratch org contains the base managed package before deploying.

All that is required in an SFDX-format project is the fields subfolder to achieve the packaging objective you've articulated.

1
  • Thanks David. That was it. The source tracking got confused from the the first attempted deploy and never recovered. One of those beautifully simple solutions. Good thinking sir! Dec 14 '20 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.