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
Gavin ChinGavin Chin 

Assistance Required: Error on Upsert invalid field...external id

Hi All,
I have contacts(updates and new) from an external system which i need to send over to Salesforce(SF) via SOAP. I have created a field (IFCS_c) as an external id with the intention to use this as part of the upsert so that SF will either create a new contact or update an existing contact. At the same time if it is a new contact i need to associate it to an existing Account record object using AccountId field in Contact. The external id field name is set to IFCS_c. The upsert for contact WSDL is as below:
  <urn:sObjects xsi:type="Contact" xmlns:xsi="">
    <urn:Contact_Type__c>Card Delivery</urn:Contact_Type__c>
    <urn:FirstName>Bob Tester</urn:FirstName>
    <urn:LastName>Bob Tester</urn:LastName>

I am getting the following message:
<con1:ReceivedFaultDetail xmlns:con1="">
      <con1:faultcode xmlns:urn="">urn:INVALID_FIELD</con1:faultcode>
      <con1:faultstring>INVALID_FIELD: Field name provided, IFCS__c does not match an External ID for Contact</con1:faultstring>
        <sf:InvalidFieldFault xsi:type="sf:InvalidFieldFault" xmlns:soapenv="" xmlns:sf="" xmlns:xsi="">
          <sf:exceptionMessage>Field name provided, IFCS__c does not match an External ID for Contact</sf:exceptionMessage>

 Any help will be great and thanks in advance.
Hi Gavin,

This might be issue with field level security of IFCS__c field for user which is used to upsert contact. 

Sunil Kumar
Anupam RastogiAnupam Rastogi
Hi Gavin,

If for a moment I ignore the fact that you wish to relate a contact to an Account as well, the upsert should work. Few things - 

 - Please make sure that you have created field IFCS__c in Contact object
 - Please make sure that this field is created as an external field

In my app, a working message is similar to yours as shown below - 
         <urn:sObjects xsi:type="urn1:Account">
         <urn:sObjects xsi:type="urn1:Account">
            <Name>Test Account Sample 9</Name>

Otherwise I do not find any reason for this error to occur.

Secondly, regarding relating a Contact to an existing Account - Relationships in salesforce are created using the relationship names. So to relate an object with another you need to use the relationship name like shown below - 
<urn:sObjects xsi:type="urn1:Contact">

Moreover you need to use an external Id field on the related to object for establishing this relationship.

So in your case, you wish to relate Contact with Account. So do the following - 

1. Create a new external Id field on Account
2. Data Load the external system Account Ids in this newly created external Id field
3. Use this field in the SOAP message (as shown below 'Siebel_Id__c' is an external Id field on the Account object in my app)

For now to test it, you can just create a new external Id field on Account, give it a dummy value for an Account, use it in the SOAP message that you are sending. This should create a new Contact that is related to this Account.


If you find this reply useful that solves your problem then please mark it as best answer.