You need to sign in to do that
Don't have an account?
rajesh kumar 10
Can any one help writing Test class for the below trigger?
trigger NCAccountApprovalSubmit on Account (after insert) {
for (Account a : trigger.new) {
if (a.RecordType_Name__c == 'Plant' && (a.Plant_Business_Type__c == 'New construction')
&& (a.plant_Type__c == 'potential plant')
&& (a.status__c!='active') && (a.super_region__c=='EAME')
&& (a.account_industry_type__c =='Power - Fossil'||a.account_industry_type__c =='O & G'))
{
Approval.ProcessSubmitRequest app = new Approval.ProcessSubmitRequest();
app.setObjectId(a.id);
Approval.ProcessResult result = Approval.process(app);
}
}
}
for (Account a : trigger.new) {
if (a.RecordType_Name__c == 'Plant' && (a.Plant_Business_Type__c == 'New construction')
&& (a.plant_Type__c == 'potential plant')
&& (a.status__c!='active') && (a.super_region__c=='EAME')
&& (a.account_industry_type__c =='Power - Fossil'||a.account_industry_type__c =='O & G'))
{
Approval.ProcessSubmitRequest app = new Approval.ProcessSubmitRequest();
app.setObjectId(a.id);
Approval.ProcessResult result = Approval.process(app);
}
}
}
Regards Nitesh