+ Start a Discussion
Chinmay AbhangraoChinmay Abhangrao 

test classs in not wrking and giving error like this anybody help/..

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ProdTrackOnAcc: execution of AfterInsert  caused by: System.ListException: Duplicate id in list: 0016F00002OuVyiQAF  Class.trigger_helper.trigger_method_when_inserted: line 54, column 1 Trigger.ProdTrackOnAcc: line 10, column 1: []
Hi Chinmay,
Mark as best answer, If it resloves !!
If its Production you're deploying to, you can't edit code in Production. You will have to "deploy" any and all code changes. Might be an idea to check with whoever put those validation rules in and who wrote those other tests. You might want to update the test classes and deploy - as they seem to be only simple data related validation errors.

Mark as resloved if it helps :) :)
Bhanu Prakash
visit ForceLearn.com​​ ​ (https://www.forcelearn.com)

Hi Chinmay,

Please try the below code for the test class
Class Helper Class
Set<id> proSet=new Set<Product>();
public static void  myMethod(List<product2> proObj)
List<product2> proList2=new List<product2>();

    FROM Product
    WHERE id in:porSet;
      insert proList2;

if you found this answer helpful then please mark it as best answer so it can help others.