You need to sign in to do that
Don't have an account?
udayarangareddy mekala
Trigger Test Class
HI
I got the error in the Trigger Test Class.The error is Selected job is not yet complete in Apex Test Execution.
Thanks&Regards
Ranga
I got the error in the Trigger Test Class.The error is Selected job is not yet complete in Apex Test Execution.
Thanks&Regards
Ranga
for (CronTrigger ct : [SELECT Id FROM CronTrigger]) {
System.abortJob(ct.Id);
}
Please try below code. I hope that will help you
Please let us know if this will help you
I want to write below trigger test class. Please help me out not getting 100% code coverage
trigger OpportunityTriggerUpdate on Opportunity (after update) {
Map <Id, Opportunity> mapOpportunity = new Map < Id, Opportunity >();
Map <Opportunity, String> Endcustomeracctype = new Map < Opportunity, String >();
List <Account> accList = new List < Account >();
List <Account> accountList = new List < Account >();
Opportunity opp = new Opportunity();
List <Id> accIdsList = new List <Id>();
for ( Opportunity oppty : trigger.new ) {
if(oppty.End_Customer__c != null){
System.debug('Print End Customer'+oppty.End_Customer__c);
accIdsList.add(oppty.End_Customer__c);
System.debug('Print Account..............'+oppty.StageName);
if(oppty.StageName == 'Contract Signed'){
System.debug('Print Account..............'+oppty.StageName);
for(Account acc : [Select Id,Name,Type from Account where ID IN : accIdsList]){
System.debug('Print Account.....'+ acc);
// acc.Type = ('Customer','Prospect');
if(acc.Type != null && acc.Type !='Partner' && acc.Type !='Competitor' && acc.Type !='Customer'){
System.debug('Print Account Type.........'+acc.Type);
acc.Type = 'Indirect Customer';
System.debug('Print Account Type.........'+acc.Type);
accList.add(acc);
System.debug('Print Account Type.........'+accList);
}
}
}
}
}
update accList;
System.debug('Update Account List...........'+accList);
}
Thanks !!