You need to sign in to do that
Don't have an account?

Trigger System.ListException: Duplicate id
Hi,
I wrote a custom trigger to update all child based on the parent value Please find trigger below.
I tested this in test instance which was working I see below error message when testing in production. Please suggest me how to fix this issue.
caused by: System.DmlException: Update failed. First exception on row 0 with id 5503400000100IYDwAAO; first error: FIELD_INTEGRITY_EXCEPTION, If you set an end date, you must also set a start date.: Start Date: [StartDate]
Thanks
Sudhir
I wrote a custom trigger to update all child based on the parent value Please find trigger below.
trigger FortuneGlobalTrg on Account (after insert, after update) { Set<id> setOfParentId = new Set<Id>(); Set<id> setOfParentIds = new Set<Id>(); for(Account pt : trigger.new){ setOfParentId.add(pt.id); } List<Account> listChild = new List<Account>([Select id, Global_2000_Rank__c,Fortune_Rank__c from Account where ParentId in :setOfParentId or id in :setOfParentIds ]); List<Account> updatedlistChild = new List<Account>(); for(Account pt : trigger.new){ for(Account ch : listChild){ ch.Global_2000_Rank__c = pt.Global_2000_Rank__c; ch.Fortune_Rank__c = pt.Fortune_Rank__c; updatedlistChild.add(ch); } } if (updatedlistChild.size() > 0 ){ Update updatedlistChild; } }
I tested this in test instance which was working I see below error message when testing in production. Please suggest me how to fix this issue.
caused by: System.DmlException: Update failed. First exception on row 0 with id 5503400000100IYDwAAO; first error: FIELD_INTEGRITY_EXCEPTION, If you set an end date, you must also set a start date.: Start Date: [StartDate]
Thanks
Sudhir
On the Production environment, there must be some kind of validation/validation in the trigger which causing this issue plz check and rectify.
Hope this will help you.
Thanks
Shall I create a helper class and call trigger inside below trigger.
Thanks
Sudhir