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
ashlin k bennyashlin k benny 

while running test class in salesforce i am getting error CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ContactTrigger: execution of AfterUpdate

@isTest
private class Test_TrialSurveyContainerController {
    @IsTest(SeeAllData=true)
    static void testRecocrTypeID() {
        
        List<Survey> survey = [SELECT Id FROM Survey WHERE ActiveVersionId != NULL LIMIT 1];
        if (survey.isEmpty())
            return;

        TriggerHandlerExecutor.bypassHandler(
            TaskTriggerHandler.SendImmediateEmailsForTaskCodeHandler.class
        );
        Test.startTest();
        TestData.loadTestData();
        Test.stopTest();

        TestData testData = new TestData();

        testData.pe.Participant_Status__c = PEStatusState.PE_STATUS_ENROLLMENT_SUCCESS;
        update testData.pe;

        Reminder_Schedule__c schedule = new Reminder_Schedule__c(First_Reminder_day__c = 1);
        insert schedule;

        Trial_Survey__c tsAllSee = new Trial_Survey__c(
            Active_After_Days__c = 0,
            Clinical_Trial_Profile__c = testData.ctp.Id,
            Expires_After_Days__c = 999,
            Survey__c = survey.get(0).Id,
            RecordTypeId = Schema.sObjectType.Trial_Survey__c.getRecordTypeInfosByName().get('Status based').getRecordTypeId(),
            Whose_response_needed__c = 'Patient or any Delegate'
        );
        insert tsAllSee;
        TrialSurveyContainerController.getRecordTypeNameById(tsAllSee.RecordTypeId);
  }
}
VinayVinay (Salesforce Developers) 
Hi Ashlin,

What is the line number which is failing and causing the issue?

Thanks,
ashlin k bennyashlin k benny
thank u it is beause error in other class
Olivia wildeOlivia wilde
Thank you for being so interested in the https://www.mycfavisit.blog/. We appreciate your feedback and value your opinion. Your input will help us enhance our services and improve the customer experience.