You need to sign in to do that
Don't have an account?
Agraj
Create Lead REST API throwing ENTITY_IS_DELETED error when creating a deleted lead again
Hello all,
I'm trying to create a lead using the Force.com REST API and able to do so successfully.
Now, I go ahead and delete that lead from Salesforce.
If I try to create the same lead again via API, then it gives the following error:
[{"fields":[],"message":"entity is deleted","errorCode":"ENTITY_IS_DELETED"}]
I also tried deleting the lead from Recycle Bin in Salesforce, but that didn't helped.
Please let me know what I'm doing wrong.
Thanks for all the replies.
The problem was in my code. It was sending a PATCH request to /services/data/v20.0/sobjects/Lead/[Lead_ID] when Lead_ID was deleted. I tried sending POST to /services/data/v20.0/sobjects/Lead/ with new Lead information and it worked.
Sorry for the inconvenience caused.
All Answers
It sounds like you may have a custom trigger on leads that is doing de-dupe, and it is flagging the error.
Hi Simon,
Thanks for your reply. I have not configured any custom triggers on leads. But could you please point me to some documentation around it so that I can check if someone else has done so.
Also, please confirm that if the lead is lying in Recycle Bin, then can i create it again or not ?
Thanks,
Agraj
One more reason you may like to look is the parent records associated to that lead is deleted .Like if any of related Id you are trying to use and if its deleted same error pops up
it will be grate if you can share the piece of code that you are using to recreate the deleted lead
then it will me more easy to figure out the problem
It may be that
Thanks for all the replies.
The problem was in my code. It was sending a PATCH request to /services/data/v20.0/sobjects/Lead/[Lead_ID] when Lead_ID was deleted. I tried sending POST to /services/data/v20.0/sobjects/Lead/ with new Lead information and it worked.
Sorry for the inconvenience caused.