Help get this topic noticed by sharing it on Twitter, Facebook, or email.

"entity is deleted" while record exists when upsert on bulkOps

We are using dbAmp to sync between our financial system and Salesforce. it is processing 506 records fine and failing on one record.
The record exists in SF, I searched both by ID and external ID. I also queried the linked server db and again the record is coming displaying.

Also, I looked at previous questions asked and I looked at flows and triggers to make sure there is some other hidden issue, and couldn't find any issue.

Any help will be appreciated,
Isaac
1 person has
this question
+1
Reply
  • What is the command you are running and what is the complete message output from the command?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • Check and make sure that all foreign key reference fields on that row in your input table point to a non-deleted record.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • Bill,
    I did check and all foreign keys exists.

    Justin, attached the command and full message:
    EXEC SF_BulkOps 'Upsert:batchsize(200)','SFProduction','Project__c_Load','Deltek_ID1and2__c'

    --- Starting SF_BulkOps for Project__c_Load V3.1.7
    16:37:13: Run the DBAmp.exe program.
    16:37:13: DBAmp Bulk Operations. V3.4.4 (c) Copyright 2006-2017 forceAmp.com LLC
    16:37:13: Upserting Salesforce using Project__c_Load (CMBDELDB2 / DBAmpProduction) .
    16:37:14: DBAmp is using the SQL Native Client.
    16:37:14: Batch size reset to 200 rows per batch.
    16:37:15: SOAP Headers:
    16:37:30: 508 rows read from SQL Table.
    16:37:30: 1 rows failed. See Error column of row for more information.
    16:37:30: 507 rows successfully processed.
    16:37:30: Errors occurred. See Error column of row for more information.
    16:37:30: Error: DBAmp.exe was unsuccessful.
    16:37:30: Error: Command string is C:\"Program Files"\DBAmp\DBAmp.exe upsert:batchsize(200) Project__c_Load "CMBDELDB2" "DBAmpProduction" "SFProduction" "Deltek_ID1and2__c" " "
    --- Ending SF_BulkOps. Operation FAILED.
    Msg 50000, Level 16, State 1, Procedure SF_BulkOps, Line 141 [Batch Start Line 0]
    SF_BulkOps Error: 16:37:13: DBAmp Bulk Operations. V3.4.4 (c) Copyright 2006-2017 forceAmp.com LLC16:37:13: Upserting Salesforce using Project__c_Load (CMBDELDB2 / DBAmpProduction) .16:37:14: DBAmp is using the SQL Native Client.16:37:14: Batch size reset to 200 rows per batch.16:37:15: SOAP Headers: 16:37:30: 508 rows read from SQL Table.16:37:30: 1 rows failed. See Error column of row for more information.16:37:30: 507 rows successfully processed.16:37:30: Errors occurred. See Error column of row for more information.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • The error message is from salesforce so there is somehting salesforce does not like about that row.

    Are you sure that the external id field used is marked as Unique on salesforce ? Perhaps there is a deleted "twin" record.

    As a final attempt, create a load table with just that record. Then, delete fields from the load table until the upsert works. That will help you isolate which field is causing the issue.

    Also, it is possible that a trigger associated with that object is throwing the error based on something failing with the trigger code.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • That is what I have been trying to identify (which field is causing the error). I might have missed something,

    i confirmed that the external id exists only once for that record.

    I modified the record in SF manually, updating the dozen or so fields we are updating and no trigger error. I also disabled triggers and flows associated with that object.

    I will try the new table with one row and delete columns until it works...

    thanks for the quick response, i'll update once I find out what was the cause.
    Isaac
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • it's always the data you are skipping... we had duplicate contact that was merged in SF but not in our other application. I checked names which matched, the ID however did not.

    Thanks for the suggestion of removing columns from the table..

    Isaac
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated