function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rajesh kumar 10rajesh kumar 10 

Can any one help writing Test class for the below trigger?

trigger NCAccountApprovalSubmit on Account (after insert) {
     for (Account a : {
        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();
            Approval.ProcessResult result = Approval.process(app);

James LoghryJames Loghry
Have you even attempted to write your own Apex Test Class yet?  Seems like that is something you should look into before posting your "Do my work for me for free" post here.  See the following link for an intro to test code:
nitesh gadkarinitesh gadkari

public class NCAccountApprovalSubmitTest {
         public static testmethod void methd1(){
                account a1=new account();
                a1.Plant_Business_Type__c='New construction';
                a1.plant_Type__c='potential plant';
                a1.account_industry_type__c='Power - Fossil';
                insert a1;
// Create an approval request for the account
        Approval.ProcessSubmitRequest req1 = 
            new Approval.ProcessSubmitRequest();
        req1.setComments('Submitting request for approval.');
        // Submit the approval request for the account
        Approval.ProcessResult result = Approval.process(req1);
        // Verify the result
// I Truely Support James but try this working code

Regards Nitesh