sf_create {salesforcer} | R Documentation |
Create Records
Description
Adds one or more new records to your organization’s data.
Usage
sf_create(
input_data,
object_name,
api_type = c("SOAP", "REST", "Bulk 1.0", "Bulk 2.0"),
guess_types = TRUE,
control = list(...),
...,
all_or_none = deprecated(),
verbose = FALSE
)
Arguments
input_data |
|
object_name |
|
api_type |
|
guess_types |
|
control |
|
... |
arguments passed to |
all_or_none |
|
verbose |
|
Value
tbl_df
of records with success indicator
Note
Because the SOAP and REST calls chunk data into batches of 200 records the AllOrNoneHeader will only apply to the success or failure of every batch of records and not all records submitted to the function.
Examples
## Not run:
n <- 2
new_contacts <- tibble(FirstName = rep("Test", n),
LastName = paste0("Contact", 1:n))
new_recs1 <- sf_create(new_contacts, object_name = "Contact")
# add control to allow the creation of records that violate a duplicate rules
new_recs2 <- sf_create(new_contacts, object_name = "Contact",
DuplicateRuleHeader=list(allowSave=TRUE,
includeRecordDetails=FALSE,
runAsCurrentUser=TRUE))
# example using the Bulk 1.0 API to insert records
new_recs3 <- sf_create(new_contacts, object_name = "Contact",
api_type = "Bulk 1.0")
## End(Not run)