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
NikithaNikitha 

Hey I'm getting err like this CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY. I think so it is recursive how to handle this type of err?

my code

public class CollegeActions {
   public static boolean flag = true;
    public static void createMarkSheet(List<college__c> collegeList ){
        List<Mark_Sheet__c> marksheetList = new List<Mark_Sheet__c>();
        for(college__c college :collegeList ){
            Mark_Sheet__c mark = new Mark_Sheet__c();
            mark.Name = college.Name;
            mark.Last_Name__c = college.Last_Name__c;
            marksheetList.add(mark);
            
        }
        if(!marksheetList.isEmpty()){
          insert marksheetList;
            
        }
        
        }
    }

In trigger 

trigger collegeInsertTrigger on college__c (after insert,after update) {
        if( CollegeActions.flag== True)
    {
        CollegeActions.flag = false;
         CollegeActions.createMarkSheet(Trigger.new);
    }
}

 
ShirishaShirisha (Salesforce Developers) 
Hi Swathi,

Greetings!

I can see that the error is incomplete to assist you further on this.However,I would suggest you to troubleshoot the issue by capturing the debug logs to fix the code.

Reference:https://help.salesforce.com/apex/HTViewHelpDoc?id=code_add_users_debug_log.htm&language=en_us

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri