0

On a custom Role__c join object that I created to establish a many to many relationship Account and Contact I am not able to upsert or create records that have been deleted. It will throw this error for every record: ENTITY IS DELETED

I can do so with Account or Contact:

  1. Add records
  2. Delete them
  3. Create them again

But the 3rd step fails if I try to do it for the custom object Role__c, with the message about records being deleted. Any idea of why this is happening? It happens using either the Bulk Api or the REST Api.

2
  • 1
    The issue was that when pulling the records from the parent tables (Account and Contact), I wasn't filtering out the records that are in the recycle bin, hence trying to link the juntion object to records that were deleted. (to filter use WHERE isDeleted = false) in your query.
    – htatche
    Commented Jul 7, 2016 at 22:34
  • 1
    Hey htache, please answer your own question with the contents of that comment. It is allowed and this could be of use to people in the future.
    – Matt Lacey
    Commented Jul 8, 2016 at 1:16

1 Answer 1

1

The issue was that when pulling the records from the parent tables (Account and Contact), I wasn't filtering out the records that are in the recycle bin, hence trying to link the junction object to records that were deleted. (to filter use WHERE isDeleted = false) in your query.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .