rforcecom.bulkAction: The 'salesforcer' backwards compatible version of the...

View source: R/compatibility.R

rforcecom.bulkActionR Documentation

The salesforcer backwards compatible version of the RForcecom function rforcecom.bulkAction

Description

[Soft-deprecated]

This function is a convenience wrapper for submitting bulk API jobs

Usage

rforcecom.bulkAction(
  session,
  operation = c("insert", "delete", "upsert", "update", "hardDelete"),
  data,
  object,
  external_id_fieldname = NULL,
  multiBatch = TRUE,
  batchSize = 10000,
  interval_seconds = 5,
  max_attempts = 100,
  verbose = FALSE
)

Arguments

session

list; a list containing "sessionID", "instanceURL", and "apiVersion" as returned by RForcecom::rforcecom.login. This argument is ignored in all backward compatible calls because the authorization credentials are stored in an environment internal to the salesforcer package, so it is no longer necessary to pass the session in each function call.

operation

a character string defining the type of operation being performed

data

a matrix or data.frame that can be coerced into a CSV file for submitting as batch request

object

a character string defining the target salesforce object that the operation will be performed on

external_id_fieldname

character; string identifying a custom field on the object that has been set as an "External ID" field. This field is used to reference objects during upserts to determine if the record already exists in Salesforce or not.

multiBatch

a boolean value defining whether or not submit data in batches to the API

batchSize

an integer value defining the number of records to submit if multiBatch is true. The max value is 10,000 in accordance with Salesforce limits.

interval_seconds

an integer defining the seconds between attempts to check for job completion

max_attempts

an integer defining then max number attempts to check for job completion before stopping

verbose

logical; an indicator of whether to print additional detail for each API call, which is useful for debugging. More specifically, when set to TRUE the URL, header, and body will be printed for each request, along with additional diagnostic information where available.

Value

A tbl_df of the results of the bulk job

References

https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch

Examples

## Not run: 
# update Account object
updates <- rforcecom.bulkAction(session, 
                                operation = 'update', 
                                data = my_data, 
                                object = 'Account')

## End(Not run)

salesforcer documentation built on March 18, 2022, 6:26 p.m.