1.0.1 • Published 8 years ago

jsforce-patient-bulk-op v1.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

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) );
  });
1.0.1

8 years ago

1.0.0

8 years ago