generated from salesforcecli/lerna-template
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
data update bulk/resume
commands (#1098)
* chore: refactor bulk ingest utils * feat: add `data update bulk/resume` * fix: update `data import bulk` help * test: add bulk update NUT * test: break up NUTs (#1099) * chore: unify bulk ingest logic * test: add bulk update NUTs to test matrix * fix: insert operation * fix: command-specific resume instructions * fix: command-specific stage title * fix: pass operation opt * test: fix update resume NUT on win * test: refactor/doc * chore: moar refactor/doc * chore: clean up msgs * feat: add column-delimiter flag to import/update bulk * chore: update command snapshot * chore: eslint rule inline * test: validate async command's cache files * chore: update msg [skip ci] * fix: edit help for new "data update bulk|resume" commands (#1106) * fix: remove `as string` * chore: use proper stop status * chore: share column-delimiter flag def * test: remove type assertions * feat: detect column delimiter * test: nut should detect column delimiter --------- Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com>
- Loading branch information
1 parent
0a5f8d8
commit 5ef1b55
Showing
40 changed files
with
1,200 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# export.resume | ||
|
||
Run "sf %s --job-id %s" to resume the operation. | ||
|
||
# error.timeout | ||
|
||
The operation timed out after %s minutes. | ||
|
||
Run "sf %s --job-id %s" to resume it. | ||
|
||
# error.failedRecordDetails | ||
|
||
Job finished being processed but failed to process %s records. | ||
|
||
To review the details of this job, run this command: | ||
|
||
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s" | ||
|
||
# error.jobFailed | ||
|
||
Job failed to be processed due to: | ||
|
||
%s | ||
|
||
To review the details of this job, run this command: | ||
|
||
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s" | ||
|
||
# error.jobAborted | ||
|
||
Job has been aborted. | ||
|
||
To review the details of this job, run this command: | ||
|
||
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s" | ||
|
||
# flags.column-delimiter.summary | ||
|
||
Column delimiter used in the CSV file. Default is COMMA. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# summary | ||
|
||
Bulk update records to an org from a CSV file. Uses Bulk API 2.0. | ||
|
||
# description | ||
|
||
You can use this command to update millions of Salesforce object records based on a file in comma-separated values (CSV) format. | ||
|
||
All the records in the CSV file must be for the same Salesforce object. Specify the object with the `--sobject` flag. The first column of every line in the CSV file must be an ID of the record you want to update. The CSV file can contain only existing records; if a record in the file doesn't currently exist in the Salesforce object, the command fails. Consider using "sf data upsert bulk" if you also want to insert new records. | ||
|
||
Bulk updates can take a while, depending on how many records are in the CSV file. If the command times out, or you specified the --async flag, the command displays the job ID. To see the status and get the results of the job, run "sf data update resume" and pass the job ID to the --job-id flag. | ||
|
||
For information and examples about how to prepare your CSV files, see "Prepare Data to Ingest" in the "Bulk API 2.0 and Bulk API Developer Guide" (https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_prepare_data.htm). | ||
|
||
# examples | ||
|
||
- Update Account records from a CSV-formatted file into an org with alias "my-scratch"; if the update doesn't complete in 10 minutes, the command ends and displays a job ID: | ||
|
||
<%= config.bin %> <%= command.id %> --file accounts.csv --sobject Account --wait 10 --target-org my-scratch | ||
|
||
- Update asynchronously and use the default org; the command immediately returns a job ID that you then pass to the "sf data update resume" command: | ||
|
||
<%= config.bin %> <%= command.id %> --file accounts.csv --sobject Account --async | ||
|
||
# flags.async.summary | ||
|
||
Don't wait for the command to complete. | ||
|
||
# flags.wait.summary | ||
|
||
Time to wait for the command to finish, in minutes. | ||
|
||
# flags.file.summary | ||
|
||
CSV file that contains the Salesforce object records you want to update. | ||
|
||
# flags.sobject.summary | ||
|
||
API name of the Salesforce object, either standard or custom, which you are updating. | ||
|
||
# flags.line-ending.summary | ||
|
||
Line ending used in the CSV file. Default value on Windows is `CRLF`; on macOS and Linux it's `LF`. | ||
|
||
# flags.column-delimiter.summary | ||
|
||
Column delimiter used in the CSV file. Default is COMMA. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# summary | ||
|
||
Resume a bulk update job that you previously started. Uses Bulk API 2.0. | ||
|
||
# description | ||
|
||
When the original "sf data update bulk" command either times out or is run with the --async flag, it displays a job ID. To see the status and get the results of the bulk update, run this command by either passing it the job ID or using the --use-most-recent flag to specify the most recent bulk update job. | ||
|
||
# examples | ||
|
||
- Resume a bulk update job of your default org using a job ID: | ||
|
||
<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA | ||
|
||
- Resume the most recently run bulk update job for an org with alias "my-scratch": | ||
|
||
<%= config.bin %> <%= command.id %> --use-most-recent --target-org my-scratch | ||
|
||
# flags.use-most-recent.summary | ||
|
||
Use the job ID of the bulk update job that was most recently run. | ||
|
||
# flags.job-id.summary | ||
|
||
Job ID of the bulk update. | ||
|
||
# flags.wait.summary | ||
|
||
Time to wait for the command to finish, in minutes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.