Learn R Programming

RForcecom (version 1.1)

rforcecom.createBulkJob: Create Bulk API Job

Description

This function initializes a Job in the Salesforce Bulk API

Usage

rforcecom.createBulkJob(session, operation=c('insert', 'delete', 'query', 'upsert', 'update', 'hardDelete'), object='Account', externalIdFieldName=NULL, concurrencyMode='Parallel')

Arguments

session
a named character vector defining parameters of the api connection as returned by rforcecom.login
operation
a character string defining the type of operation being performed
object
a character string defining the target salesforce object that the operation will be performed on
externalIdFieldName
a character string identifying a custom field that has the "External ID" attribute on the target object. This field is only used when performing upserts. It will be ignored for all other operations.
concurrencyMode
a character string either "Parallel" or "Serial" that specifies whether batches should be completed sequentially or in parallel. Use "Serial" only if Lock contentions persist with in "Parallel" mode.

Value

A list parameters defining the created job, including id

References

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

Examples

Run this code
## Not run: 
# # insert into Account
# job_info <- rforcecom.createBulkJob(session, operation='update', object='Account')
# 
# # delete from Account
# job_info <- rforcecom.createBulkJob(session, operation='delete', object='Account')
# 
# # update into Account
# job_info <- rforcecom.createBulkJob(session, operation='update', object='Account')
# 
# # upsert into Account
# job_info <- rforcecom.createBulkJob(session, operation='upsert',
#                                     externalIdFieldName='My_External_Id__c',
#                                     object='Account')
# 
# # insert attachments
# job_info <- rforcecom.createBulkJob(session, operation='insert', object='Attachment')
# ## End(Not run)

Run the code above in your browser using DataLab