+ Start a Discussion
Albert HernandezAlbert Hernandez 

Issue with upsert to custom object ‘Account_Balance_by_Entity’ which has Account__c as Lookup fields.


We are facing an issue in our production environment for one of the customer while sending data to Salesforce to upsert the custom object ‘Account_Balance_by_Entity’ which has Account__c as Lookup field.

For example, we are getting the error  “Attempting to update (as part of an upsert) parent field Account__c with new value 001E000000BsqzVIAR, current value is 001E000000BsqzvIAB”.

It is noticeable that two accounts have unique Id(from url) with same order of alphanumeric combinations, one ending with lower case and another upper case.
One account has ID like 001E000000BsqzV and another like 001E000000Bsqzv.
Everything are in same order, only one ends with upper case 'V' and another ends with lower case 'v'.

We send the ‘upsert’ request to SFDC which has 001E000000BsqzV and get error for another similar ID 001E000000Bsqzv. There are many such combination of accounts in our customer’s Salesforce company.
Could you please suggest us how to fix this issue?

Any account which does not have similar other account Id then posting works fine.

Few details about custom object:
Object Name:    Account_Balance_by_Entity
API Name:          Account_Balance_by_Entity__c

Standard Fields:
Label                                     Field Name         Data Type           
Created By                          CreatedBy           Lookup(User)    
Currency                              CurrencyIsoCode             Picklist 
Intacct Entity Name        Name                    Text(80)               
Last Modified By              LastModifiedBy Lookup(User)    
Owner                                  Owner                  Lookup(User,Queue)

Custom Fields & Relationships
Field Label           API Name            Data Type                           
Account               Account__c        Lookup(Account)
Balance                Balance__c         Currency(16, 2)
External Id          External_Id__c Text(80) (External ID) (Unique Case Insensitive)

Here is the XML request and response:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:partner.soap.sforce.com" xmlns:ns2="urn:sobject.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <ns1:sessionId>******SessionId here***** </ns1:sessionId>
         <ns1:defaultNamespace xsi:nil="true" />
            <ns2:Id xsi:nil="true" />
            <Name>ACC-US--Accruent USA</Name>


<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
               <message>Attempting to update (as part of an upsert) parent field Account__c with new value 001E000000BsqzVIAR, current value is 001E000000BsqzvIAB</message>
            <id xsi:nil="true" />

I dont think the Account Ids are same, in Salesforce the IDs are 15 character case sensitive and 18 case Insensitive, so even if you take the Account Id one with lower case and one with upper case they are different.

Have you confirmed if they are different or same, by checking them in Salesforce? 
Albert HernandezAlbert Hernandez
Thanks logontokartik,

Yes, I have confirmed that these accounts are different in Salesforce.

Could you please elaborate and explain, what does it mean by
“in Salesforce the IDs are 15 character case sensitive and 18 case Insensitive”
Forza di SognoForza di Sogno
You should probably use the case-safe 18-digit version of the ID.  Create a formula field (e.g. "ID_Case_Safe") with CASESAFEID(ID) and use that instead of the regular Id.