Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Revert "Revert "Bugfix/document content type""
Browse files Browse the repository at this point in the history
  • Loading branch information
hiratake55 committed Feb 9, 2017
1 parent aa01d88 commit 37b2a62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 5 additions & 7 deletions R/rforcecom.createBulkJob.R
Expand Up @@ -7,13 +7,15 @@
#' 'query', 'upsert',
#' 'update', 'hardDelete'),
#' object='Account',
#' contentType=c('CSV', 'ZIP_CSV', 'ZIP_XML', 'ZIP_JSON'),
#' externalIdFieldName=NULL,
#' concurrencyMode='Parallel')
#' @concept bulk job salesforce api
#' @references \url{https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/}
#' @param session a named character vector defining parameters of the api connection as returned by \link{rforcecom.login}
#' @param operation a character string defining the type of operation being performed
#' @param object a character string defining the target salesforce object that the operation will be performed on
#' @param contentType a character string being one of 'CSV','ZIP_CSV','ZIP_XML', or 'ZIP_JSON'
#' @param 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.
#' @param concurrencyMode a character string either "Parallel" or "Serial" that specifies whether batches should be completed
Expand Down Expand Up @@ -43,19 +45,15 @@ rforcecom.createBulkJob <-
function(session, operation=c('insert', 'delete', 'query',
'upsert', 'update', 'hardDelete'),
object='Account',
contentType=c('CSV', 'ZIP_CSV', 'ZIP_XML', 'ZIP_JSON'),
externalIdFieldName=NULL,
concurrencyMode='Parallel'){

if(operation=='upsert'){
if(operation == 'upsert'){
stopifnot(!is.null(externalIdFieldName))
}

if (object == 'Attachment') {
if (operation != 'insert') stop('only insert operations are supported for the Attachment object')
contentType <- 'ZIP_CSV'
} else {
contentType <- 'CSV' # user cannot control type
}
contentType <- match.arg(contentType)

# XML Body
xmlBody <- paste0('<?xml version="1.0" encoding="UTF-8"?>
Expand Down
3 changes: 3 additions & 0 deletions man/rforcecom.createBulkJob.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 37b2a62

Please sign in to comment.