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
keerthana chowdharykeerthana chowdhary 

error while running test class

@isTest
public class TestEnrolmentFormWarningPageController
 {
static testmethod void validateStandardController1(){
 Profile p = [SELECT Id FROM Profile WHERE Name='RMS Developer']; 
      User u2 = new User(Alias = 'newUser', Email='subramani.ramamurthy@cgi.com', 
         EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
         LocaleSidKey='en_US', ProfileId = p.Id, 
         TimeZoneSidKey='America/Los_Angeles', UserName='subramani.ramamurthy@cgi.com');

      System.runAs(u2) {
String str = [Select Id From RecordType Where SobjectType = 'EnrolmentForm__c' and Name ='ESS New Enrolment' LIMIT 1].Id;
EnrolmentForm__c enroll=new EnrolmentForm__c(Mobile__c='989898999',Email__c='sundhar@gmail.com',EnrolmentStatusCode__c='Unprocessed',Council_Area__c='maharastra',FormValidationFlag__c = true,RecordTypeId=str );
insert enroll;
     ApexPages.currentpage().getparameters().put('id', enroll.id);
        
   ApexPages.StandardController sc1 = new ApexPages.StandardController(enroll);
  EnrolmentFormWarningPageControllerExt cont = new EnrolmentFormWarningPageControllerExt(sc1);
EnrolmentForm__c enroll1=new EnrolmentForm__c(Mobile__c='989898999',Email__c='sundhar@gmail.com',EnrolmentStatusCode__c='Unprocessed',Council_Area__c='maharastra',FormValidationFlag__c = false,RecordTypeId=str );
insert enroll1;
     
     ApexPages.currentpage().getparameters().put('id', enroll1.id);
     ApexPages.StandardController sc2 = new ApexPages.StandardController(enroll1);
  EnrolmentFormWarningPageControllerExt cont1 = new EnrolmentFormWarningPageControllerExt(sc2);
  
  }
}
}
error

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 301O00000009tJz. Contact your administrator for help.: []