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

Can someone help me understand why it is that when I removed the claims from the Claims table, the Account associated with the claims is also removed?

My issue is with the Salesforce tables and how the table objects relate to each other. The reason for my query is that I am attempting to remove rows from my Claims table object but when I do so, the related row on my Accounts table is also removed. My assumption was that since the Account table is the “parent” of the Claims table and that if a claim is removed, that should not remove the parent as well. There should be a one-to-many relationship between the Accounts table and the Claims table. Meaning the Account table can have many Claims objects associated with it, so if a claim is removed, the other claims remain and the account remains as well. Conversely, if the Account is removed from the Accounts table, then the claims associated with that account become orphans and are therefore not viable and are removed.
1 person has
this question
+1
Reply
  • Also, it should be noted that I used the SF_Bulkops stored procedure to perform the delete operation which yielded the following error message:

    Input Table = sf.dbo.claims__c_Delete

    exec sf_bulkops 'Delete','Salesforce','claims__c_Delete'

    --- Starting SF_BulkOps for claims__c_Delete
    15:24:06: Run the DBAmp.exe program.
    15:24:06: DBAmp Bulk Operations. V2.12.4 (c) Copyright 2006-2009 forceAmp.com LLC
    15:24:06: Deleting Id's using claims__c_Delete (servername / database) .
    15:59:53: 66251 rows read from SQL Table.
    15:59:53: 60467 rows failed. See Error column of row for more information.
    15:59:53: 5784 rows succesfully processed.
    15:59:53: Errors occurred. See Error column of row for more information.
    15:59:53: Error: DBAmp.exe was unsuccessful.
    15:59:53: Error: Command string is C:\"Program Files"\DBAmp\DBAmp.exe delete claims__c_Delete "servername" "database" "Salesforce"
    --- Ending SF_BulkOps. Operation FAILED.
    Msg 50000, Level 16, State 1, Procedure SF_BulkOps, Line 93
    --- Ending SF_BulkOps. Operation FAILED.
  • (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

  • First, all the actions you are describing are occurring on the salesforce server. DBAmp simply forwards your request to delete that claim record to salesforce.

    It is not normal in the salesforce api for the parent record to delete as well. My guess is that your organization has some APEX trigger code on the salesforce server that is adding the additional action of deleting the parent when there are no claims. Also, if you are new to salesforce perhaps you setup the relationship between claim and account backwards making the claim record the parent. If you need help exploring what triggers are on the object, let me know and we can do a web meeting

    I see that the delete failed for the majority of the records. What was in the error column for those failed records ? Also, are you sure that you populated the claims__c_delete with ONLY ids of claim records ?
  • (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