Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Java Development
- :
- A duplicate value was specified for field 'Id'
turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
0
A duplicate value was specified for field 'Id'
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-06-2012 08:36 AM
I've got a problem with partner API.
I'm using PartnerConnection generated with wsc-22.jar and when I execute some simple query like "SELECT Id, Name, ... FROM MyObject__c" I get this as one of objects:
XmlObject{
name={urn:partner.soap.sforce.com}records,
value=null,
children=[
XmlObject{name={urn:sobject.partner.soap.sforce.co m}type, value=MyObject__c, children=[]},
XmlObject{name={urn:sobject.partner.soap.sforce.co m}Id, value=a01d0000006j5TQAAY, children=[]},
XmlObject{name={urn:sobject.partner.soap.sforce.co m}Id, value=a01d0000006j5TQAAY, children=[]},
XmlObject{name={urn:sobject.partner.soap.sforce.co m}Name, value=myName, children=[]},
...
XmlObject{name={urn:sobject.partner.soap.sforce.co
XmlObject{name={urn:sobject.partner.soap.sforce.co
XmlObject{name={urn:sobject.partner.soap.sforce.co
...
]}
as you see there are two Id attributes with the same value. And if i try to update this object later I get "A duplicate value was specified for field 'Id' in object 'MyObject__c', duplicate value 'a01d0000006j5TQAAY' prior value 'a01d0000006j5TQAAY'"
When I try to execute something like "SELECT Name, ... FROM MyObject__c" without Id I get:
XmlObject{
name={urn:partner.soap.sforce.com}records,
value=null,
children=[
as you see there are two Id attributes with the same value. And if i try to update this object later I get "A duplicate value was specified for field 'Id' in object 'MyObject__c', duplicate value 'a01d0000006j5TQAAY' prior value 'a01d0000006j5TQAAY'"
When I try to execute something like "SELECT Name, ... FROM MyObject__c" without Id I get:
XmlObject{
name={urn:partner.soap.sforce.com}records,
value=null,
children=[
XmlObject{name={urn:sobject.partner.soap.sforce.co m}type, value=MyObject__c, children=[]},
XmlObject{name={urn:sobject.partner.soap.sforce.co m}Id, value=null, children=[]},
XmlObject{name={urn:sobject.partner.soap.sforce.co m}Name, value=myName, children=[]},
...
XmlObject{name={urn:sobject.partner.soap.sforce.co
XmlObject{name={urn:sobject.partner.soap.sforce.co
...
]}
And can't update this object, because it has no Id.
What am I doing wrong?
0
Re: A duplicate value was specified for field 'Id'
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-31-2013 05:09 AM
Hi,
have seen that also in my code.
You could use the workarund to remove the field "Id" (yourObjectC.removeField("Id")).
If both fields are removed then add it once (yourObjectC.setField("Id", "a01d0000006j5TQAAY"))

