2

Can I use an autonumber field as an external Id for API upsert?

2

You can not actually do that, but what you can do is create an external field, and an autonumber field. Then create a workflow that fills the external ID field by the autonumber field value :)

3
  • 1
    I'm pretty sure that would still cause upsert problems. You'd almost need a trigger to manage the current autonumber value. – sfdcfox Mar 18 '16 at 14:47
  • I am using Camel salesforce rest API , I have a custom object Called Ra_Message__c. I am using the Patch api call /services/data/v33.0/sobjects/Ra_Message__c/External_Id__c/R****1800000** : it is returning the following error. {message:'Error {400:Bad Request} executing {PATCH:/services/data/v33.0/sobjects/Ra_Message__c/External_Id__c/R****1800000*}',statusCode:400} – cloudy-ritz Mar 18 '16 at 14:50
  • 1
    @sfdcfox if the external ID gets sets after creation of the record using the workflow I think the autonumber(Salesforce) should be set then. Unless I haven't understood what exactly OP needs. – raym0nd Mar 18 '16 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.