You need to sign in to do that
Don't have an account?
Can't figure out DML Exception
Hi All,
Can someone help me figure out what the problem is with the update unit test?
I'm trying to see if my trigger will pass the 200 mark :)
static testmethod void test_CircuitHandling(){
List<Circuits__c> newckts = new List<Circuits__c>();
for(integer i=0; i<=199; i++ ){
newckts.add(new Circuits__c(Circuit_Status__c = 'Pending', RecordTypeId = '01230000000LSN1AAO'));
}
Database.Saveresult[] results = Database.insert(newckts);
System.assertEquals(results.size(), 200);
Set<Id> Ids = new Set<Id>();
for(Circuits__c ckts : newckts){
Ids.add(ckts.Id);
}
List<Circuits__c> upList = [select Circuit_Status__c, Id From Circuits__c Where Id =: Ids];
List<Circuits__c> updList = new List<Circuits__c>();
for(Circuits__c cktList: upList){
cktList.Circuit_Status__c = 'Active';
cktList.Service_Start_Date__c = system.today();
updList.add(cktList);
}
if(!updList.isEmpty()){
Database.Saveresult[] upResults = Database.update(updList);
}
}
Thanks in advance,
Does it say why?? Look in the debug log and it will tell you the reason why as well.
All Answers
I forgot to mention that it gives me the CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY error
Does it say why?? Look in the debug log and it will tell you the reason why as well.