-
Notifications
You must be signed in to change notification settings - Fork 78
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
Retrieve Bulk Job V2 error messages #2221
Comments
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. |
This issue has been linked to a new work item: W-13599839 |
thanks for filing this @R0Wi - sounds like a great enhancement |
Thanks @WillieRuemmele . Would be great if we could discuss the CLI interface changes in detail, then I'd bring in a PR for this within the next weeks 👍 |
@R0Wi - of course, we can definitely work on some designs. I bet they'd be pretty similar to what's printed when there's a failing component during a deploy, or a failing apex test like
or
I'm not sure what data will be available in that API response, but adding enough information to help someone figure out where the mistake is will be great. We can also add a |
Sounds good, thanks @WillieRuemmele for the quick feedback. Accoding to the docs the SF API will return the results directly in CSV format (this holds not only for the failed results but also for the success and "not processed" results). So as a first improvement I could imagine using a sf data delete bulk --help
Only disadvantage here is that the output cannot be further processed by any automation and it can fill your std-out quite a bit if you're dealing with a lot of records 😄 Later we could also think about writing back the results to a copy of the source CSV file, like SFDMU and Data Loader do it. So then the source CSV file would get two additional columns |
@WillieRuemmele PR is here: salesforcecli/plugin-data#615. We might need to discuss some technical details there if needed 👍 |
Description
The new
sf
CLIdata
commands are using the Salesforce Bulk Job V2 API to upsert or delete records. This applies tosf data delete bulk
sf data upsert bulk
Sometimes it happens that some datasets cannot be deleted or upserted, which results in a message, printed to the CLI like this:
Unfortunately the CLI doesn't tell us what exactly went wrong. Also, since we're dealing with Bulk API V2, the results cannot be downloaded via Salesforce GUI. The only quite cumbersome solution is to use the REST API to check the results
Proposal
For the two aforementioned commands, it would be great to have some flag like
--show-errors
, which will download the errors after the action and either print them to the stdout or to some.csv
-file. I think the current implementation is already downloading the job results viajsforce
getAllResults()
but the results are only used to print the summary shown above, not the details.Current workaround
sf org display
to get the Access TokenOR
Use the global
--json
flag. But this will print all results (succeeded, failed, not processed), which can be quite hard to read.Contribution
If you're interested in this feature, I'd be glad to bring in a PR for this. We should just clarify the exact flag specification and which commands to be adjusted.
The text was updated successfully, but these errors were encountered: