@salesforce/plugin-data 3.9.0 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,9 +6,8 @@
6
6
  */
7
7
  import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
8
8
  import { Messages } from '@salesforce/core';
9
- import { ensureString } from '@salesforce/ts-types';
10
9
  import { BulkImportRequestCache } from '../../../bulkDataRequestCache.js';
11
- import { BulkImportStages } from '../../../ux/bulkImportStages.js';
10
+ import { bulkIngestResume } from '../../../bulkIngest.js';
12
11
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
13
12
  const messages = Messages.loadMessages('@salesforce/plugin-data', 'data.import.resume');
14
13
  export default class DataImportResume extends SfCommand {
@@ -36,61 +35,14 @@ export default class DataImportResume extends SfCommand {
36
35
  };
37
36
  async run() {
38
37
  const { flags } = await this.parse(DataImportResume);
39
- const cache = await BulkImportRequestCache.create();
40
- const resumeOpts = await cache.resolveResumeOptionsFromCache(flags['job-id'] ?? flags['use-most-recent']);
41
- const conn = resumeOpts.options.connection;
42
- const stages = new BulkImportStages({
43
- resume: true,
44
- title: 'Importing data',
45
- baseUrl: ensureString(conn.getAuthInfoFields().instanceUrl),
38
+ return bulkIngestResume({
39
+ cmdId: 'data import resume',
40
+ stageTitle: 'Updating data',
41
+ cache: await BulkImportRequestCache.create(),
42
+ jobIdOrMostRecent: flags['job-id'] ?? flags['use-most-recent'],
46
43
  jsonEnabled: this.jsonEnabled(),
44
+ wait: flags.wait,
47
45
  });
48
- stages.start();
49
- const job = conn.bulk2.job('ingest', {
50
- id: resumeOpts.jobInfo.id,
51
- });
52
- stages.setupJobListeners(job);
53
- try {
54
- await job.poll(5000, flags.wait.milliseconds);
55
- const jobInfo = await job.check();
56
- // send last data update so job status/num. of records processed/failed represent the last update
57
- stages.update(jobInfo);
58
- if (jobInfo.numberRecordsFailed) {
59
- stages.error();
60
- // TODO: replace this msg to point to `sf data bulk results` when it's added (W-12408034)
61
- throw messages.createError('error.failedRecordDetails', [
62
- jobInfo.numberRecordsFailed,
63
- conn.getUsername(),
64
- job.id,
65
- ]);
66
- }
67
- stages.stop();
68
- return {
69
- jobId: jobInfo.id,
70
- processedRecords: jobInfo.numberRecordsProcessed,
71
- successfulRecords: jobInfo.numberRecordsProcessed - (jobInfo.numberRecordsFailed ?? 0),
72
- failedRecords: jobInfo.numberRecordsFailed,
73
- };
74
- }
75
- catch (err) {
76
- const jobInfo = await job.check();
77
- // send last data update so job status/num. of records processed/failed represent the last update
78
- stages.update(jobInfo);
79
- if (err instanceof Error && err.name === 'JobPollingTimeout') {
80
- stages.error();
81
- throw messages.createError('error.timeout', [flags.wait.minutes, job.id]);
82
- }
83
- if (jobInfo.state === 'Failed') {
84
- stages.error();
85
- throw messages.createError('error.jobFailed', [jobInfo.errorMessage, conn.getUsername(), job.id], [], err);
86
- }
87
- if (jobInfo.state === 'Aborted') {
88
- stages.error();
89
- // TODO: replace this msg to point to `sf data bulk results` when it's added (W-12408034)
90
- throw messages.createError('error.jobAborted', [conn.getUsername(), job.id], [], err);
91
- }
92
- throw err;
93
- }
94
46
  }
95
47
  }
96
48
  //# sourceMappingURL=resume.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resume.js","sourceRoot":"","sources":["../../../../src/commands/data/import/resume.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAA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EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAErD,OAAO,gBAAgB,CAAC;YACtB,KAAK,EAAE,oBAAoB;YAC3B,UAAU,EAAE,eAAe;YAC3B,KAAK,EAAE,MAAM,sBAAsB,CAAC,MAAM,EAAE;YAC5C,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC;YAC9D,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;YAC/B,IAAI,EAAE,KAAK,CAAC,IAAI;SACjB,CAAC,CAAC;IACL,CAAC"}
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Copyright (c) 2024, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
8
+ import { Messages } from '@salesforce/core';
9
+ import { bulkIngest, columnDelimiterFlag } from '../../../bulkIngest.js';
10
+ import { BulkUpdateRequestCache } from '../../../bulkDataRequestCache.js';
11
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
12
+ const messages = Messages.loadMessages('@salesforce/plugin-data', 'data.update.bulk');
13
+ export default class DataUpdateBulk extends SfCommand {
14
+ static summary = messages.getMessage('summary');
15
+ static description = messages.getMessage('description');
16
+ static examples = messages.getMessages('examples');
17
+ static flags = {
18
+ async: Flags.boolean({
19
+ summary: messages.getMessage('flags.async.summary'),
20
+ char: 'a',
21
+ }),
22
+ wait: Flags.duration({
23
+ summary: messages.getMessage('flags.wait.summary'),
24
+ char: 'w',
25
+ unit: 'minutes',
26
+ }),
27
+ file: Flags.file({
28
+ summary: messages.getMessage('flags.file.summary'),
29
+ char: 'f',
30
+ required: true,
31
+ exists: true,
32
+ }),
33
+ sobject: Flags.string({
34
+ summary: messages.getMessage('flags.sobject.summary'),
35
+ char: 's',
36
+ required: true,
37
+ }),
38
+ 'api-version': Flags.orgApiVersion(),
39
+ 'target-org': Flags.requiredOrg(),
40
+ 'line-ending': Flags.option({
41
+ summary: messages.getMessage('flags.line-ending.summary'),
42
+ dependsOn: ['file'],
43
+ options: ['CRLF', 'LF'],
44
+ })(),
45
+ 'column-delimiter': columnDelimiterFlag,
46
+ };
47
+ async run() {
48
+ const { flags } = await this.parse(DataUpdateBulk);
49
+ return bulkIngest({
50
+ resumeCmdId: 'data update resume',
51
+ stageTitle: 'Updating data',
52
+ object: flags.sobject,
53
+ operation: 'update',
54
+ lineEnding: flags['line-ending'],
55
+ columnDelimiter: flags['column-delimiter'],
56
+ conn: flags['target-org'].getConnection(flags['api-version']),
57
+ cache: await BulkUpdateRequestCache.create(),
58
+ async: flags.async,
59
+ wait: flags.wait,
60
+ file: flags.file,
61
+ jsonEnabled: this.jsonEnabled(),
62
+ logFn: (...args) => {
63
+ this.log(...args);
64
+ },
65
+ });
66
+ }
67
+ }
68
+ //# sourceMappingURL=bulk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk.js","sourceRoot":"","sources":["../../../../src/commands/data/update/bulk.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,kBAAkB,CAAC,CAAC;AAStF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,SAA+B;IAClE,MAAM,CAAU,OAAO,GAA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AAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAEnD,OAAO,UAAU,CAAC;YAChB,WAAW,EAAE,oBAAoB;YACjC,UAAU,EAAE,eAAe;YAC3B,MAAM,EAAE,KAAK,CAAC,OAAO;YACrB,SAAS,EAAE,QAAQ;YACnB,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC;YAChC,eAAe,EAAE,KAAK,CAAC,kBAAkB,CAAC;YAC1C,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YAC7D,KAAK,EAAE,MAAM,sBAAsB,CAAC,MAAM,EAAE;YAC5C,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;YAC/B,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE;gBACjB,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;YACpB,CAAC;SACF,CAAC,CAAC;IACL,CAAC"}
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Copyright (c) 2024, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
8
+ import { Messages } from '@salesforce/core';
9
+ import { BulkUpdateRequestCache } from '../../../bulkDataRequestCache.js';
10
+ import { bulkIngestResume } from '../../../bulkIngest.js';
11
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
12
+ const messages = Messages.loadMessages('@salesforce/plugin-data', 'data.update.resume');
13
+ export default class DataUpdateResume extends SfCommand {
14
+ static summary = messages.getMessage('summary');
15
+ static description = messages.getMessage('description');
16
+ static examples = messages.getMessages('examples');
17
+ static flags = {
18
+ 'use-most-recent': Flags.boolean({
19
+ summary: messages.getMessage('flags.use-most-recent.summary'),
20
+ exactlyOne: ['job-id'],
21
+ }),
22
+ 'job-id': Flags.salesforceId({
23
+ summary: messages.getMessage('flags.job-id.summary'),
24
+ char: 'i',
25
+ length: 18,
26
+ startsWith: '750',
27
+ exactlyOne: ['use-most-recent'],
28
+ }),
29
+ wait: Flags.duration({
30
+ char: 'w',
31
+ unit: 'minutes',
32
+ summary: messages.getMessage('flags.wait.summary'),
33
+ defaultValue: 5,
34
+ }),
35
+ };
36
+ async run() {
37
+ const { flags } = await this.parse(DataUpdateResume);
38
+ return bulkIngestResume({
39
+ cmdId: 'data update resume',
40
+ stageTitle: 'Updating data',
41
+ cache: await BulkUpdateRequestCache.create(),
42
+ jobIdOrMostRecent: flags['job-id'] ?? flags['use-most-recent'],
43
+ jsonEnabled: this.jsonEnabled(),
44
+ wait: flags.wait,
45
+ });
46
+ }
47
+ }
48
+ //# sourceMappingURL=resume.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume.js","sourceRoot":"","sources":["../../../../src/commands/data/update/resume.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,oBAAoB,CAAC,CAAC;AASxF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,SAAiC;IACtE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAA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iStageOutput } from '@oclif/multi-stage-output';
8
8
  import terminalLink from 'terminal-link';
9
- export class BulkImportStages {
9
+ export class BulkIngestStages {
10
10
  mso;
11
11
  resume;
12
12
  constructor({ resume, title, baseUrl, jsonEnabled }) {
@@ -87,11 +87,11 @@ export class BulkImportStages {
87
87
  update(data) {
88
88
  this.mso.updateData(data);
89
89
  }
90
- stop() {
91
- this.mso.stop();
90
+ stop(finalStatus) {
91
+ this.mso.stop(finalStatus);
92
92
  }
93
93
  error() {
94
94
  this.mso.error();
95
95
  }
96
96
  }
97
- //# sourceMappingURL=bulkImportStages.js.map
97
+ //# sourceMappingURL=bulkIngestStages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bulkImportStages.js","sourceRoot":"","sources":["../../src/ux/bulkImportStages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,OAAO,YAAY,MAAM,eAAe,CAAC;AASzC,MAAM,OAAO,gBAAgB;IACnB,GAAG,CAA8B;IACjC,MAAM,CAAU;IAExB,YAAmB,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAW;QACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,IAAI,gBAAgB,CAAY;YACzC,KAAK;YACL,WAAW;YACX,MAAM,EAAE,CAAC,qBAAqB,EAAE,oBAAoB,CAAC;YACrD,kBAAkB,EAAE;gBAClB;oBACE,KAAK,EAAE,oBAAoB;oBAC3B,KAAK,EAAE,mBAAmB;oBAC1B,IAAI,EAAE,mBAAmB;oBACzB,GAAG,EAAE,CAAC,IAAI,EAAsB,EAAE;wBAChC,IAAI,IAAI,EAAE,sBAAsB,EAAE,CAAC;4BACjC,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,CAAC;wBAChD,CAAC;oBACH,CAAC;iBACF;gBACD;oBACE,KAAK,EAAE,oBAAoB;oB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.timeout
6
+
7
+ The operation timed out after %s minutes.
8
+
9
+ Run "sf %s --job-id %s" to resume it.
10
+
11
+ # error.failedRecordDetails
12
+
13
+ Job finished being processed but failed to process %s records.
14
+
15
+ # error.failedRecordDetails.actions
16
+
17
+ - Get the job results by running: "sf data bulk results -o %s --job-id %s".
18
+ - View the job in the org: "sf org open -o %s --path '/lightning/setup/AsyncApiJobStatus/page?address=%2F%s'".
19
+
20
+ # error.jobFailed
21
+
22
+ Job failed to be processed due to:
23
+
24
+ %s
25
+
26
+ # error.jobFailed.actions
27
+
28
+ - Get the job results by running: "sf data bulk results -o %s --job-id %s".
29
+ - View the job in the org: "sf org open -o %s --path '/lightning/setup/AsyncApiJobStatus/page?address=%2F%s'".
30
+
31
+ # error.jobAborted
32
+
33
+ Job has been aborted.
34
+
35
+ # error.jobAborted.actions
36
+
37
+ - Get the job results by running: "sf data bulk results -o %s --job-id %s".
38
+ - View the job in the org: "sf org open -o %s --path '/lightning/setup/AsyncApiJobStatus/page?address=%2F%s'".
39
+
40
+ # flags.column-delimiter.summary
41
+
42
+ Column delimiter used in the CSV file. Default is COMMA.
@@ -0,0 +1,41 @@
1
+ # summary
2
+
3
+ Get the results of a bulk ingest job that you previously ran.
4
+
5
+ # description
6
+
7
+ Use this command to get the complete results after running one of the CLI commands that uses Bulk API 2.0 to ingest (import, update, upsert, or delete) large datasets to your org, such as "data import bulk". The previously-run bulk command must have completed; if it's still processing, run the corresponding resume command first, such as "data import resume." Make note of the job ID of the previous bulk command because you use it to run this command.
8
+
9
+ You can also use this command to get results from running a bulk ingest job with a different tool, such as Data Loader, as long as you have the job ID. For information on Data Loader, see https://developer.salesforce.com/docs/atlas.en-us.dataLoader.meta/dataLoader/data_loader_intro.htm.
10
+
11
+ This command first displays the status of the previous bulk job, the operation that was executed in the org (such as insert or hard delete), and the updated Salesforce object. The command then displays how many records were processed in total, and how many were successful or failed. Finally, the output displays the names of the generated CSV-formatted files that contain the specific results for each ingested record. Depending on the success or failure of the bulk command, the results files can include the IDs of inserted records or the specific errors. When possible, if the ingest job failed or was aborted, you also get a CSV file with the unprocessed results.
12
+
13
+ # flags.job-id.summary
14
+
15
+ Job ID of the bulk job.
16
+
17
+ # examples
18
+
19
+ - Get results from a bulk ingest job; use the org with alias "my-scratch":
20
+
21
+ <%= config.bin %> <%= command.id %> --job-id 7507i000fake341G --target-org my-scratch
22
+
23
+ # error.jobInProgress
24
+
25
+ Job hasn't finished being processed yet.
26
+
27
+ # error.invalidId
28
+
29
+ Can't find a bulk job with ID %s.
30
+
31
+ # error.invalidId.actions
32
+
33
+ - Ensure the ID is from a previously run bulk ingest job, and not a query job.
34
+
35
+ - Run this command and verify that the job ID for the bulk command exists in your org:
36
+
37
+ sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F750"
38
+
39
+ # error.noRecords
40
+
41
+ Unable to get results because the job processed 0 records.
@@ -1,6 +1,6 @@
1
1
  # summary
2
2
 
3
- Resume a bulk export job that you previously started.
3
+ Resume a bulk export job that you previously started. Uses Bulk API 2.0.
4
4
 
5
5
  # description
6
6
 
@@ -40,40 +40,8 @@ Time to wait for the command to finish, in minutes.
40
40
 
41
41
  # flags.line-ending.summary
42
42
 
43
- Line ending used in the CSV file. Default value on Windows is `CRLF`; on macOS and Linux it's `LR`.
43
+ Line ending used in the CSV file. Default value on Windows is `CRLF`; on macOS and Linux it's `LF`.
44
44
 
45
- # export.resume
45
+ # flags.column-delimiter.summary
46
46
 
47
- Run "sf data import resume --job-id %s" to resume the operation.
48
-
49
- # error.timeout
50
-
51
- The operation timed out after %s minutes.
52
-
53
- Run "sf data import resume --job-id %s" to resume it.
54
-
55
- # error.failedRecordDetails
56
-
57
- Job finished being processed but failed to import %s records.
58
-
59
- To review the details of this job, run this command:
60
-
61
- sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
62
-
63
- # error.jobFailed
64
-
65
- Job failed to be processed due to:
66
-
67
- %s
68
-
69
- To review the details of this job, run this command:
70
-
71
- sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
72
-
73
- # error.jobAborted
74
-
75
- Job has been aborted.
76
-
77
- To review the details of this job, run this command:
78
-
79
- sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
47
+ Column delimiter used in the CSV file. Default is COMMA.
@@ -27,35 +27,3 @@ Job ID of the bulk import.
27
27
  # flags.wait.summary
28
28
 
29
29
  Time to wait for the command to finish, in minutes.
30
-
31
- # error.failedRecordDetails
32
-
33
- Job finished being processed but failed to import %s records.
34
-
35
- To review the details of this job, run this command:
36
-
37
- sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
38
-
39
- # error.timeout
40
-
41
- The operation timed out after %s minutes.
42
-
43
- Try re-running "sf data import resume --job-id %s" with a bigger wait time.
44
-
45
- # error.jobFailed
46
-
47
- Job failed to be processed due to:
48
-
49
- %s
50
-
51
- To review the details of this job, run this command:
52
-
53
- sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
54
-
55
- # error.jobAborted
56
-
57
- Job has been aborted.
58
-
59
- To review the details of this job, run this command:
60
-
61
- sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
@@ -0,0 +1,47 @@
1
+ # summary
2
+
3
+ Bulk update records to an org from a CSV file. Uses Bulk API 2.0.
4
+
5
+ # description
6
+
7
+ You can use this command to update millions of Salesforce object records based on a file in comma-separated values (CSV) format.
8
+
9
+ 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.
10
+
11
+ 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.
12
+
13
+ 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).
14
+
15
+ # examples
16
+
17
+ - 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:
18
+
19
+ <%= config.bin %> <%= command.id %> --file accounts.csv --sobject Account --wait 10 --target-org my-scratch
20
+
21
+ - 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:
22
+
23
+ <%= config.bin %> <%= command.id %> --file accounts.csv --sobject Account --async
24
+
25
+ # flags.async.summary
26
+
27
+ Don't wait for the command to complete.
28
+
29
+ # flags.wait.summary
30
+
31
+ Time to wait for the command to finish, in minutes.
32
+
33
+ # flags.file.summary
34
+
35
+ CSV file that contains the Salesforce object records you want to update.
36
+
37
+ # flags.sobject.summary
38
+
39
+ API name of the Salesforce object, either standard or custom, which you are updating.
40
+
41
+ # flags.line-ending.summary
42
+
43
+ Line ending used in the CSV file. Default value on Windows is `CRLF`; on macOS and Linux it's `LF`.
44
+
45
+ # flags.column-delimiter.summary
46
+
47
+ Column delimiter used in the CSV file. Default is COMMA.
@@ -0,0 +1,29 @@
1
+ # summary
2
+
3
+ Resume a bulk update job that you previously started. Uses Bulk API 2.0.
4
+
5
+ # description
6
+
7
+ 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.
8
+
9
+ # examples
10
+
11
+ - Resume a bulk update job of your default org using a job ID:
12
+
13
+ <%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA
14
+
15
+ - Resume the most recently run bulk update job for an org with alias "my-scratch":
16
+
17
+ <%= config.bin %> <%= command.id %> --use-most-recent --target-org my-scratch
18
+
19
+ # flags.use-most-recent.summary
20
+
21
+ Use the job ID of the bulk update job that was most recently run.
22
+
23
+ # flags.job-id.summary
24
+
25
+ Job ID of the bulk update.
26
+
27
+ # flags.wait.summary
28
+
29
+ Time to wait for the command to finish, in minutes.