You need to sign in to do that
Don't have an account?
System.listexception: row with duplicate name
We have a test class that is now failing with this error:
System.DmlException: Upsert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AssetTrigger: execution of AfterInsert
caused by: System.DmlException: Update failed. First exception on row 0 with id 0016C000007X172QAC; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AccountTrigger: execution of BeforeUpdate
caused by: System.ListException: Row with duplicate Name at index: 2
Trigger.AccountTrigger: line 48, column 1: []
Class.dlrs.RollupService.Updater.updateRecords: line 1248, column 1 Class.dlrs.RollupService.UpdateWithoutSharing.updateRecords: line 1291, column 1 Class.dlrs.RollupService.updateRecords: line 1219, column 1 Class.dlrs.RollupService.handleRollups: line 855, column 1 Class.dlrs.RollupService.rollup: line 205, column 1 Trigger.AssetTrigger: line 40, column 1: []
I assume the main issue is the duplicate row name so I searched arounf for that. I saw this thread https://developer.salesforce.com/forums/?id=906F000000091hDIAQ, and I tried to change to SOQL as the last answer suggested but that didn't help. I also added debug statements to the AccountTrigger after line 48, one of which counts the number in the map, and it does match the number in our custom setting. Maybe of note, we have a custom setting from a managed package that has the same name, just with the namespace on the front. But that is not new. What is new is that we were using Rollup Helper and are now trying to implement Declarative Lookup Rollup Summary Tool: https://github.com/afawcett/declarative-lookup-rollup-summaries
Any ideas? Thanks so much to anyone who even looks and considers trying to help!
System.DmlException: Upsert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AssetTrigger: execution of AfterInsert
caused by: System.DmlException: Update failed. First exception on row 0 with id 0016C000007X172QAC; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AccountTrigger: execution of BeforeUpdate
caused by: System.ListException: Row with duplicate Name at index: 2
Trigger.AccountTrigger: line 48, column 1: []
Class.dlrs.RollupService.Updater.updateRecords: line 1248, column 1 Class.dlrs.RollupService.UpdateWithoutSharing.updateRecords: line 1291, column 1 Class.dlrs.RollupService.updateRecords: line 1219, column 1 Class.dlrs.RollupService.handleRollups: line 855, column 1 Class.dlrs.RollupService.rollup: line 205, column 1 Trigger.AssetTrigger: line 40, column 1: []
I assume the main issue is the duplicate row name so I searched arounf for that. I saw this thread https://developer.salesforce.com/forums/?id=906F000000091hDIAQ, and I tried to change to SOQL as the last answer suggested but that didn't help. I also added debug statements to the AccountTrigger after line 48, one of which counts the number in the map, and it does match the number in our custom setting. Maybe of note, we have a custom setting from a managed package that has the same name, just with the namespace on the front. But that is not new. What is new is that we were using Rollup Helper and are now trying to implement Declarative Lookup Rollup Summary Tool: https://github.com/afawcett/declarative-lookup-rollup-summaries
Any ideas? Thanks so much to anyone who even looks and considers trying to help!
Can you post the code of the triggers:1) AssetTrigger: execution of AfterInsert and 2) AccountTrigger: execution of BeforeUpdate ?
System.listexception: row with "duplicate name" is less common than "duplicate id".
Many people could you if they can read the code otherwise it will be difficult to find a solution.
Class.dlrs.RollupService.Updater.updateRecords: line 1248, column 1:
try {
return Database.update(masterRecords, allOrNothing);
} catch (DMLException e) {
RollupService alone is not enough for helping you.