View source: R/update-metadata.R
sf_update_metadata | R Documentation |
This function takes a list of Metadata components and sends them to Salesforce to update an object that already exists
sf_update_metadata( metadata_type, metadata, control = list(...), ..., all_or_none = deprecated(), verbose = FALSE )
metadata_type |
|
metadata |
|
control |
|
... |
arguments passed to |
all_or_none |
|
verbose |
|
A tbl_df
containing the creation result for each submitted metadata component
The update key is based on the fullName parameter of the metadata, so updates are triggered when an existing Salesforce element matches the metadata type and fullName.
## Not run: # create an object that we can update base_obj_name <- "Custom_Account1" custom_object <- list() custom_object$fullName <- paste0(base_obj_name, "__c") custom_object$label <- paste0(gsub("_", " ", base_obj_name)) custom_object$pluralLabel <- paste0(base_obj_name, "s") custom_object$nameField <- list(displayFormat = 'AN-{0000}', label = paste0(base_obj_name, ' Number'), type = 'AutoNumber') custom_object$deploymentStatus <- 'Deployed' custom_object$sharingModel <- 'ReadWrite' custom_object$enableActivities <- 'true' custom_object$description <- paste0(base_obj_name, " created by the Metadata API") custom_object_result <- sf_create_metadata(metadata_type = 'CustomObject', metadata = custom_object) # now update the object that was created update_metadata <- custom_object update_metadata$fullName <- 'Custom_Account1__c' update_metadata$label <- 'New Label Custom_Account1' update_metadata$pluralLabel <- 'Custom_Account1s_new' updated_custom_object_result <- sf_update_metadata(metadata_type = 'CustomObject', metadata = update_metadata) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.