Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5966025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:43:57+00:00 2026-05-22T19:43:57+00:00

When using the Salesforce SOAP API via PHP, if I have an object which

  • 0

When using the Salesforce SOAP API via PHP, if I have an object which has a look-up field to an account with a specific field on the account which is set up as an external id, I can do the following

$sfBooking->fields['Account__r'] = "<type>Account</type>"
    . "<custom_account_id__c>"
    . utf8_encode($tboxBooking->client_id)
    . "</custom_account_id__c>";

This is quite handy when trying to link records without have to resort to using their Salesforce ID.

I’m wondering is there a similar type of shorthand I can use when setting up the Record Type on objects via the API. Having to get the record type id by first querying the Record Type object is a step I’d like to cut out if at all possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:43:58+00:00Added an answer on May 22, 2026 at 7:43 pm

    You can do this using the name field on RecordType, your generated xml should look like

        <create xmlns="urn:partner.soap.sforce.com">
            <sobject>
                <type>case</type>
                <subject>Test</subject>
                <recordType>
                    <type>RecordType</type>
                    <name>InternetCase</name>
                </recordType>
            </sobject>
        </create>
    

    based on the code you posted, you’d do

    $sfBooking->fields['RecordType'] = "<type>RecordType</type>"
        . "<name>"
        . utf8_encode($tboxBooking->recordType_name)
        . "</name>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script which fetches data from Salesforce via the Salesforce API
I am successfully creating a Task using the SalesForce API SOAP API through Java.
When using the SOAP API to work with salesforce.com (SFDC) it seems that the
I have been using SOAP to deal with Salesforce.com and have been using the
I am using Flex-Force API to connect to Salesforce. I have hard coded my
I have been supplied a form by Salesforce.com for which I need to do
Using PHP, I'm trying to give each specific text its own variable. I believe
I am using a 3rd-party rotator object, which is providing a smooth, random rotation
I'm using Salesforce.com Toolkit for PHP and I'm trying to output something I think
When using the Salesforce Partner API (version 21.0), how can I determine if the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.