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.
You can do this using the name field on RecordType, your generated xml should look like
based on the code you posted, you’d do