Usage
sf_find_duplicates(
search_criteria,
object_name,
include_record_details = FALSE,
guess_types = TRUE,
verbose = FALSE
)
Arguments
- search_criteria
list
; a list of fields and their values that would constitute a match. For example, list(FirstName="Marc", Company="Salesforce")- object_name
character
; the name of the Salesforce object that the function is operating against (e.g. "Account", "Contact", "CustomObject__c").- include_record_details
logical
; get fields and values for records detected as duplicates by setting this property toTRUE
. Get only record IDs for records detected as duplicates by setting this property toFALSE
.- guess_types
logical
; indicating whether or not to usecol_guess()
to try and cast the data returned in the recordset. IfTRUE
thencol_guess()
is used along withanytime()
andanydate()
. IfFALSE
then all fields will be returned as character. SpecifyingFALSE
helpful when guessing the column data type will result in NA values and you would like to return the results as strings and then cast in your script according to your unique specifications.- verbose
logical
; an indicator of whether to print additional detail for each API call, which is useful for debugging. More specifically, when set toTRUE
the URL, header, and body will be printed for each request, along with additional diagnostic information where available.
Note
You must have active duplicate rules for the supplied object before running
this function. The object_name
argument refers to using that object's duplicate
rules on the search criteria to determine which records in other objects are duplicates.
Examples
if (FALSE) { # \dontrun{
# use the duplicate rules associated with the Lead object on the search
# criteria (email) in order to find duplicates
found_dupes <- sf_find_duplicates(search_criteria =
list(Email="bond_john@grandhotels.com"),
object_name = "Lead")
# now look for duplicates on email using the Contact object's rules
found_dupes <- sf_find_duplicates(search_criteria =
list(Email="bond_john@grandhotels.com"),
object_name = "Contact")
} # }