rforcecom.createBulkBatch: Create and Add Batches to a Bulk API Job

Description Usage Arguments Value References Examples

View source: R/rforcecom.createBulkBatch.R

Description

This function takes a data frame and submits it in batches to a an already existing Bulk API Job by chunking into temp files

Usage

1
rforcecom.createBulkBatch(session, jobId, data, multiBatch=TRUE, batchSize=10000)

Arguments

session

a named character vector defining parameters of the api connection as returned by rforcecom.login

jobId

a character string defining the salesforce id assigned to a submitted job as returned by rforcecom.createBulkJob

data

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

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 10000 in accordance with salesforce limits.

Value

A list of lists, one for each batch submitted, containing 10 parameters of the batch

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 

# inserting 2 records
my_data <- data.frame(Name=c('New Record 1', 'New Record 2'), 
                      My_External_Id__c=c('11111','22222'), 
                      stringsAsFactors=FALSE)
batches_info <- rforcecom.createBulkBatch(session, 
                                          jobId=job_info$id, 
                                          data=my_data, 
                                          multiBatch=TRUE, 
                                          batchSize=50)
#upserting 3 records
my_data <- data.frame(My_External_Id__c=c('11111','22222', '99999'), 
                      Name=c('Updated_Name1', 'Updated_Name2', 'Upserted_Record'), 
                      stringsAsFactors=FALSE)
batches_info <- rforcecom.createBulkBatch(session, 
                                          jobId=job_info$id, 
                                          data=my_data, 
                                          multiBatch=TRUE, 
                                          batchSize=50)

## End(Not run)

RForcecom documentation built on May 1, 2019, 6:31 p.m.