• Santhosh Sarangi
  • NEWBIE
  • -1 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 7
    Replies
Hi All,

I'm trying to Upsert the data to Account object using an external tool, Everything works fine but Salesforce is throwing error for few records when upserting

I was doing the upsertion process using the external id field. Except external id field no other field is having a unique constraint.

I'm getting the following error -

": SF_ERROR: DUPLICATE_VALUE
OBJ: Account - duplicate value found: unknown duplicates value on record with id: 001*********** ".

Please help me to solve the issue.

Thanks in advance.
Hi All,

I'm trying to Upsert the data to Account object using an external tool, Everything works fine but Salesforce is throwing error for few records when upserting

I was doing the upsertion process using the external id field. Except external id field no other field is having a unique constraint.

I'm getting the following error -

": SF_ERROR: DUPLICATE_VALUE
OBJ: Account - duplicate value found: unknown duplicates value on record with id: 001*********** ".

Please help me to solve the issue.

Thanks in advance.

I have found documentation on how to create an Account and Contact in one API call, yet when I try it I get an error.  There seems to be a contradiction in what the documentation states and what the API will accept.

 

The document reference is:

 

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_create.htm#MixedSaveSection

 

... and states:

 

You can create records for multiple object types, including custom objects, in one call with API version 20.0 and later. For example, you could create a contact and an account in one call. You can create records for up to 10 object types in one call. 

 

Java examples are shown where an Account and Contact are passed to the create call.

 

 

Yet when I try this I get:

 

Exception in thread "main"       ...

...

Caused by: com.sforce.soap.enterprise.InvalidSObjectFault: INVALID_TYPE: all sObjects in create or update must be of same type

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

      at java.lang.reflect.Constructor.newInstance(Unknown Source)

      at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:127)

      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)

      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)

      at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)

      at $Proxy46.create(Unknown Source)

      ... 1 more

 

I have checked the API version we are using and it is Salesforce.com Enterprise Web Services API Version 23.0

 

Here is the code snippet:

 

List<SObject> sobjects = new ArrayList<SObject>();
Contact contact = new Contact();
//... set stuff on the contact
Account account = new Account();
account.setAccountId__C(getJAXBElement("AccountId__C", Double.class, getId()));
contact.setAccount(getJAXBElement("Account", Account.class, account));
//crete the account reference and add to the array
Account accountReference = new Account();
accountReference.setAccountId__C(getJAXBElement("AccountId__C", Double.class, getId()));
sobjects.add(accountReference);
sobjects.add(contact);
apiContext.getPort().create(sobjects);

 

Thanks for any assistance!

Robin