question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to force:source:retrieve to exclude Managed Package's components

See original GitHub issue

I’d like to have an option on the force:source:retrieve command that allows me to include/excludes Managed Pakage’s components automatically. For example, in case I installed a Managed Package that adds some fields on the Account object, when running this command sfdx force:source:retrieve -m CustomObject:Account I’ll also retrieve all the fields created by the Managed Package.

Describe the solution you’d like An option that could look like this: sfdx force:source:retrieve -m CustomObject:Account --exclude-managed-components In this case all the fields that are part of a Managed Package won’t be retrieved.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:11
  • Comments:5

github_iconTop GitHub Comments

10reactions
ralphcallawaycommented, Apr 17, 2020

the inverse of this might also be considered, currently if you retrieve all custom objects, i’d expect get unmanaged fields on managed objects, but i get nothing

seems like the default behavior should be

  • don’t retrieve managed metadata (listviews, customfields, buttons, etc.) that’s part of unmanaged metadata (mainly custom objects)
  • retrieve unmanaged metadata (listviews, custom fields, etc.) that are part of managed metadata (mainly custom object)

right now you get managed metadata you don’t want, and you don’t get unmanaged metadata you would, makes CI difficult due to errors about not being able to modify managed metadata, or having to manually specify unmanaged metadata

0reactions
jonnypetragliacommented, Jun 14, 2021

This is so incredibly crucial. Why would I want to check managed elements into my source control? All it does is cause deployment errors and I’m having to write scripting to clean specific XML files matching name patterns when Salesforce already knows what’s managed or not.

Honestly, this should exclude all packaged components including unmanaged packages. Same deal for managed only even more reasoning: packages are meant to be using push and pull so the ability to exclude them has to be present (if not the default).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add option to force:source:retrieve to exclude Managed ...
I'd like to have an option on the force:source:retrieve command that allows me to include/excludes Managed Pakage's components automatically.
Read more >
Can I exclude standard object fields from a managed package?
I'm trying to migrate metadata from one org to another using a package and the sfdx force:mdapi: ...
Read more >
Tasks Reference - CumulusCI 3.71.0 documentation
Required. The full command to run with the sfdx cli. Default: force:source:pull. --extra EXTRA. Optional. Append additional options to the command ...
Read more >
Facts on Salesforce DX Project
Retrieve Source from an Existing Managed Package ... Retrieve the metadata. ... The username can be a username or alias for the target...
Read more >
How to generate package.xml automatically for salesforce ...
npm install --global force-dev-tool force-dev-tool remote add mydev user pass ... on a regular expression, so you can easily e.g. exclude managed packages, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found