• Andrew Nguyen 61
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
When creating a new Lead via an API call, I need to set the RecordType.  To do that, it seems as if I need the RecordTypeId.  But for testing, that ID is going to be different in Sandbox vs. Production.  So I don't want to hardcode the RecordTypeId.

When creating a new Lead via API, is there a way to specify the Record Type using its name instead of its ID?  Or at least have the API look up the RecordTypeId based on its name?
I'm able to create a new Lead through the API but unable to set the RecordTypeId. Even if I set the RecordTypeId in the request, and the request succeeds it will always fallback to the default Record Type.

I have checked the accessability level of the RecordTypeId field and it is editable by all.

Does anyone know where I'm going wrong?