function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Zack WaltonZack Walton 

Salesforce DX extension package

I am trying to push a managed extension package to a scratch org but am running into some issues. The issues seem to be stemed around some custom objects that are owned by the package that is being extended. I have added the "extension" fields and can see that the objects are being added to the extension package but it is still erroring. I have attatched the errors below.
 
force-app/main/default/objects/inscor__Allocation__c.object-meta.xml                      Must specify a non-empty label for the CustomObject
N/A                                                                                       Field Employee__r does not exist. Check spelling. (88:13)
N/A                                                                                       referenceTo value of 'inscor__Company_Location__c' does not resolve to a valid sObject type (66:13)
N/A                                                                                       referenceTo value of 'inscor__Part_Master__c' does not resolve to a valid sObject type (138:13)
force-app/main/default/objects/inscor__Employee__c.object-meta.xml                        Must specify a non-empty label for the CustomObject
N/A                                                                                       referenceTo value of 'inscor__Employee__c' does not resolve to a valid sObject type (66:13)
N/A                                                                                       referenceTo value of 'inscor__Employee__c' does not resolve to a valid sObject type (66:13)
N/A                                                                                       referenceTo value of 'inscor__Inventory_Line__c' does not resolve to a valid sObject type (66:13)
N/A                                                                                       referenceTo value of 'inscor__Employee__c' does not resolve to a valid sObject type (66:13)
force-app/main/default/layouts/Work_Order__c-Work Order Layout.layout-meta.xml            In field: field - no CustomField named Work_Order__c.Company_Location__c found (18:26)
force-app/main/default/layouts/Labor_Entry__c-Labor Entry Layout.layout-meta.xml          In field: field - no CustomField named Labor_Entry__c.Employee__c found (20:26)
force-app/main/default/layouts/Tool_Assignment__c-Tool Assignment Layout.layout-meta.xml  In field: field - no CustomField named Tool_Assignment__c.Employee__c found (28:26)
force-app/main/default/layouts/Work_Order_Task__c-Work Order Task Layout.layout-meta.xml  In field: field - no CustomField named Work_Order_Task__c.Assigned_To__c found (55:26)
force-app/main/default/applications/AvSight_Work_Order.app-meta.xml                       In field: tab - no CustomTab named Administration found

 
Best Answer chosen by Zack Walton
Akhilesh Reddy BaddigamAkhilesh Reddy Baddigam
Hi Zack to install Managed Package using Salesforce DX, please follow this link (https://salesforce.stackexchange.com/questions/185840/how-to-install-managed-package-using-salesforce-dx-cli). if this helps out to solve your problem please choose this as the best answer.

Thank you!

All Answers

Akhilesh Reddy BaddigamAkhilesh Reddy Baddigam
Hi Zack to install Managed Package using Salesforce DX, please follow this link (https://salesforce.stackexchange.com/questions/185840/how-to-install-managed-package-using-salesforce-dx-cli). if this helps out to solve your problem please choose this as the best answer.

Thank you!
This was selected as the best answer
Zack WaltonZack Walton
I followed the steps to try and deploy but with no success. I get a Package Not Found error. I am probably missing something. I created a packages directory with a package.xml and a sub folder installedPackages. Inside Installed packages I have a inscor.installedPackage. Do I need to retrieve the managed package before deploying?

 
Akhilesh Reddy BaddigamAkhilesh Reddy Baddigam
Hi zack if it is confusing for you, please follow this command as described in the secont best answer in the above link.

sfdx force:package:install -i 04t6A0000004eytQAA

The id here is no the id in the app exchange but the id which you get in the install for admins, install for all page after you try to install the package manually in a example org!

Hope you understand this!
Thank you!
Akhilesh Reddy BaddigamAkhilesh Reddy Baddigam

Hi Zack, if you were trying to use metadata to achieve this make sure you use the correct version! if both these solutions didnt resolve please let me know the managed package in the app exchange that you are trying to install using salesforce DX, i will try, and let you know.

thank you!

Zack WaltonZack Walton
It is not published on the App Exchange. Both of those ways didn't work for me. The install cmd just came back with 
ERROR running force:package:install:  Encountered errors installing the package!,<empty>
ERROR running force:package:install:  <empty>.
Akhilesh Reddy BaddigamAkhilesh Reddy Baddigam
Hi Zack as per my understanding the issue is you were trying to install extension components to a managed package, so before using any commands related to extensions package, you must make sure you install its dependency package i (https://help.salesforce.com/articleView?id=publish_extensions.htm&type=0)n one of the two ways
Zack WaltonZack Walton
The managed package was installed on the dev env. Then I created the extension components which were some objects and page layouts. There were also some fields that were added to the core package. Then I created a managed package with the extension components which added the dependency. Then I retrieved that managed package from the dev env using sfdx. Then I created a scratch org and tried to push. That is what caused the inital errors. I was thinking that the dependencies would be retrieved with the rest of the source code. 
Akhilesh Reddy BaddigamAkhilesh Reddy Baddigam
HI Zack, please install the managed package alone first using one of the methods and then try to push the extensions, that how it worked for me as you can see in the post in the stack overflow!
 
Zack WaltonZack Walton
I ended up installing the package onto the scratch org doing the normal interactive install. 
Zack WaltonZack Walton
Thanks for all of your help though!!!