Skip to content

Commit

Permalink
sf bulk expands references
Browse files Browse the repository at this point in the history
  • Loading branch information
taylordowns2000 committed Feb 29, 2024
1 parent 20d0fba commit 1113832
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/salesforce/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
"sObject",
"operation",
"options",
"fun"
"records"
],
"docs": {
"description": "Create and execute a bulk job.",
Expand Down Expand Up @@ -390,12 +390,12 @@
},
{
"title": "param",
"description": "A function which takes state and returns an array.",
"description": "an array of records, or a function which returns an array.",
"type": {
"type": "NameExpression",
"name": "Function"
},
"name": "fun"
"name": "records"
},
{
"title": "returns",
Expand Down
6 changes: 3 additions & 3 deletions packages/salesforce/src/Adaptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export function bulk(sObject, operation, options, records) {
const { failOnError, allowNoOp, pollTimeout, pollInterval } = options;

const [resolvedSObject, resolvedOperation, resolvedRecords] =
expandReferences(state, sObject, operation, records);
newExpandReferences(state, sObject, operation, records);

if (allowNoOp && resolvedRecords.length === 0) {
console.info(
Expand All @@ -336,10 +336,10 @@ export function bulk(sObject, operation, options, records) {
return state;
}

if (records.length > 10000)
if (resolvedRecords.length > 10000)
console.log('Your batch is bigger than 10,000 records; chunking...');

const chunkedBatches = chunk(records, 10000);
const chunkedBatches = chunk(resolvedRecords, 10000);

return Promise.all(
chunkedBatches.map(
Expand Down

0 comments on commit 1113832

Please sign in to comment.