Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract deeply nested (more than 1 level) plan #2663

Closed
mshanemc opened this issue Jan 23, 2024 Discussed in #2359 · 3 comments
Closed

Extract deeply nested (more than 1 level) plan #2663

mshanemc opened this issue Jan 23, 2024 Discussed in #2359 · 3 comments
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@mshanemc
Copy link
Contributor

from Shane, debugging info:

The code here https://github.com/salesforcecli/plugin-data/blob/3036c362566026b0d67ce66feb7e925087fa72b8/src/api/data/tree/exportApi.ts#L334-L335 delete record[key]; will remove the child record. It should have, instead, looked through each childRecords's fields to see if any of them hasNestedRecords. Probably should also be a recursive function itself, modifying the objects.

The CLI's code is what's preventing it from handling more than 2 levels of object. The API and SOQL support up to 5 these days.

Discussed in #2359

Originally posted by mnunezdm March 28, 2019
Is your feature request related to a problem? Please describe.

Extracting data with the sfdx force:data:tree:export only allows to extract one level of nested elements. I think it would be great to extract deeply nested plans like for example: Account->Case->Task

I managed to manually extract the data in two steps, manually edit the data plan, and insert them using the sfdx force:data:tree:import -p

Describe the solution you'd like

Ability to, for example, retrieve a list of queries and make the plan automatically for example:

$ sfdx force:data:tree:export -p -q "SELECT Id, Name (SELECT Origin FROM Cases) FROM Account"
                                    "SELECT Id, (SELECT Id FROM Tasks), (SELECT Id FROM Events) FROM Case"

Describe alternatives you've considered

NA

Additional context

This is the workaround I did: https://salesforce.stackexchange.com/questions/240042/sfdx-forcedatatreeexport-beyond-1-level-deep/255711#255711

@mshanemc mshanemc added feature Issue or pull request for a new feature bug Issue or pull request that identifies or fixes a bug and removed feature Issue or pull request for a new feature labels Jan 23, 2024
Copy link

Thank you for filing this feature request. We appreciate your feedback and will review the feature at our next grooming or sprint planning session. We prioritize feature requests with more upvotes and comments.

Copy link

git2gus bot commented Jan 23, 2024

This issue has been linked to a new work item: W-14876905

@jshackell-sfdc
Copy link
Collaborator

This issue is fixed in CLI version 2.30.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug
Projects
None yet
Development

No branches or pull requests

2 participants