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

Query Record Types in R #58

Open
mbhfromla-zz opened this issue Mar 24, 2017 · 1 comment
Open

Query Record Types in R #58

mbhfromla-zz opened this issue Mar 24, 2017 · 1 comment

Comments

@mbhfromla-zz
Copy link

Greetings, our team is trying to determine the syntax for selecting record type IDs when creating object records. For instance, If I am looking to do a bulk upload, I'd like to assign a record type to it, what is the best method for invoking the Record Type in R?

@StevenMMortimer
Copy link
Contributor

@mbhfromla Record Types are assigned a unique 18-character identifier and stored in the RecordType object. Query that object to find out the associated names. Once you have the Id of the type you'd like to asssign a record then, just include that in your upload.

query <- "SELECT Id, Name from RecordType"
rforcecom.query(session=session, soqlQuery=query)

Update an account to change it's Record Type

 objectName <- "Account"
 id <- "999x000000xxxxxZZZ"
 fields <- c(Phone="9999-9999-9999", RecordTypeId="01298765432111AAA")
 rforcecom.update(session, objectName, id, fields)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants