The following is my test class, and I am getting the error CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, PriceBookEntryUpdate: execution of AfterInsert on PriceBookEntryUpdate. How do I deal with another trigger causing my trigger problems? I thought I could take the test class from PriceBook and insert it into my mine, but to no avail.. Is this error telling the truth or could there be underlying problems?
@isTest
private class AutoPopulateSampleTest{
static testMethod void updateResponsibleforEVBBuildMethod1(){
Product2 prod2 = new Product2();
prod2.Name='TestProduct';
prod2.IsActive=True;
prod2.AE_Text__c='TestText';
prod2.Item_number__c='TestNumber';
prod2.AE2__c = '005E0000000RYQBIA4';
prod2.Business_Unit__c ='Nissan';
prod2.Item_class__c ='CK';
prod2.PME_Text__c='Michael';
insert prod2;
Sampling__c s= new Sampling__c();
s.Name='TestEVB';
s.Product__c = prod2.id;
s.Quantity_of_Samples__c =12;
//s.Responsible_for_EVB_Build1__c=prod2.AE2__c;
insert s;
}
static testMethod void updateResponsibleforEVBBuildMethod2(){
Product2 prod = new Product2();
prod.Name='TestProduct';
prod.IsActive=True;
prod.Item_number__c='TestNumber';
prod.AE_Text__c=null;
prod.AE2__c = '005E0000000RYQBIA4';
prod.Business_Unit__c ='Nissan';
prod.Item_class__c ='CK';
prod.PME_Text__c='Michael';
insert prod;
Sampling__c s= new Sampling__c();
s.Name='TestEVB';
s.Product__c = prod.id;
s.Quantity_of_Samples__c =23;
insert s;
}
}
Trigger.PriceBookEntryUpdate: line 42, column 1
15:26:20.657 (9548317000)|CUMULATIVE_LIMIT_USAGE
15:26:20.657|LIMIT_USAGE_FOR_NS|(default)|
Number of SOQL queries: 3 out of 100
Number of query rows: 1468 out of 50000
Number of SOSL queries: 0 out of 20
Number of DML statements: 1 out of 150
Number of DML rows: 1 out of 10000
Maximum CPU time: 0 out of 10000
Maximum heap size: 0 out of 6000000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 100
Number of record type describes: 0 out of 100
Number of child relationships describes: 0 out of 100
Number of picklist describes: 0 out of 100
Number of future calls: 0 out of 10
15:26:20.657|CUMULATIVE_LIMIT_USAGE_END
15:26:23.548 (9548396000)|CODE_UNIT_FINISHED|PriceBookEntryUpdate on Product2 trigger event AfterInsert for [01tM0000003IPst]
15:26:23.552 (9552102000)|DML_END|[14]
15:26:23.552 (9552201000)|EXCEPTION_THROWN|[14]|System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, PriceBookEntryUpdate: execution of AfterInsert
caused by: System.QueryException: List has no rows for assignment to SObject
Trigger.PriceBookEntryUpdate: line 42, column 1: []
15:26:23.553 (9553859000)|FATAL_ERROR|System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, PriceBookEntryUpdate: execution of AfterInsert
caused by: System.QueryException: List has no rows for assignment to SObject