jsforce-patient-bulk-op

1.0.1 • Public • Published

jsforce-patient-bulk-op

An npm module to bulk insert/upsert to Salesforce via jsforce with patience, adjustable timeout & poll frequency.

Build Status

Usage

npm install jsforce-patient-bulk-op --save

Begin with an authenticated jsforce connection. jsforce-connection creates one based on the SALESFORCE_URL env variable, or directly use jsforce's Connection.

Returns a Promise for the completed response of a Bulk API operation.

Example

const jsforceConnection = require('jsforce-connection');
const patientBulkOp = require('jsforce-patient-bulk-op');
 
return jsforceConnection()
  .then( salesforceApi => {
 
    return patientBulkOp(
      salesforceApi,  // A jsforce Connection
      'Account',      // Name of a custom or standard sObject
      // Array of records to be inserted
      [
        { Name: 'Zushi Co.' },
        { Name: 'MUJI' }
      ],
      'insert',       // Operation to perform
      601000,         // Timeout ms, 10-min default, just beyond Salesforce's
      2000,           // Poll Interval ms, 2-second default
      console.log     // A function to call with messages to log, default is no-op
    )
    .then( result => console.log(result) );
  });

Readme

Keywords

Package Sidebar

Install

npm i jsforce-patient-bulk-op

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mars