- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- 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
12-21-2009 09:30 AM
Does an upsert always need a field that is an externalID?
I am trying to upsert a standard object (Account), in which i wanted to do it based on Account Name.
This is my code:
sforce.UpsertResult upResult2 = binding.upsert("Name", objList2);
but when i run it, it ends up saying "Field name provided, Name does not match an External ID, Salesforce Id, or indexed field for Account"
what can i do to fix this error?
12-29-2009 03:22 PM - edited 12-29-2009 03:23 PM
See the doc at
On custom objects, upsert() uses an indexed custom field called an external ID to determine whether to create a new object
or update an existing object. On standard objects, this call can use the name of any field with the idLookup field property
instead of the external ID.
The Name field in Account does not have the idLookup field property. You can use the ID field instead or see the link above for a Java sample that uses a custom external ID field on Account. I hope that helps ...