This function is a wrapper around sf_delete
that accepts a list
of Ids and assumes that they are in the Attachment object and should be deleted.
This function is solely provided as a convenience and to provide the last
attachment function to parallel the CRUD functionality for all other records.
vector
, matrix
, data.frame
, or
tbl_df
; if not a vector, there must be a column called Id (case
insensitive) that can be passed in the request.
character
; the name of the Salesforce object that the
function is operating against (e.g. "Account", "Contact", "CustomObject__c").
character
; one of "REST"
, "SOAP"
,
"Bulk 1.0"
, or "Bulk 2.0"
indicating which API to use when
making the request.
arguments passed to sf_control
or further downstream
to sf_bulk_operation
logical
; an indicator of whether to print additional
detail for each API call, which is useful for debugging. More specifically, when
set to TRUE
the URL, header, and body will be printed for each request,
along with additional diagnostic information where available.
tbl_df
with details of the deleted records
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.
Other Attachment functions:
check_and_encode_files()
,
sf_create_attachment()
,
sf_download_attachment()
,
sf_update_attachment()
if (FALSE) {
# upload a PDF to a particular record as an Attachment
file_path <- system.file("extdata",
"data-wrangling-cheatsheet.pdf",
package = "salesforcer")
parent_record_id <- "0036A000002C6MmQAK" # replace with your own ParentId!
attachment_details <- tibble(Body = file_path, ParentId = parent_record_id)
create_result <- sf_create_attachment(attachment_details)
# now delete the attachment
# note that the function below is just running the following!
# sf_delete(ids = create_result$id)
sf_delete_attachment(ids = create_result$id)
}