function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jimc507jimc507 

Upsert using Partner WSDL - INVALID_FIELD

Hello,

I am trying to run a test upsert into a sandbox environment but am getting the following error. For now I am using SOAP UI to test.

Here is the SOAP request body:



Universal_ID__c


Account
100004446
005S0000000QOth
PersonAccount
Dpxonf
Itsauwxggb





4974
4974@test.com
Personal Trial
May 28, 2004 - Aug 05, 2004
Expired




At first I did not supply the record type and received:




true


record type missing for: Account
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY


false





After adding the RecordType - PersonAccount I received:




false


The external foreign key reference does not reference a valid entity: RecordType
INVALID_FIELD


false




What am I missing or need to do to get this to work.

Thanks in advance.
Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
You should be setting the recordTypeId field.

All Answers

SuperfellSuperfell
You should be setting the recordTypeId field.
This was selected as the best answer
jimc507jimc507
Thanks for the response but I am somewhat still confused.

If I specify the record type as PersonAccount and
set the RecordTypeID with the ID (I retrieved from the URL on the PersonAccount page) with Universal_ID__c

I get:
Cannot specify both an external ID reference RecordType and a salesforce id, RecordTypeId


Without the RecordTypeID specified I get

The external foreign key reference does not reference a valid entity: RecordType

Any help would be greatly appreciated.

Thanks.
SuperfellSuperfell
Just set the recordTypeId not the recordType.