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
aklkkaklkk 

how to code coverage the trigger ?

hi,

i am faceing a probject for coverage a unit test code please help me ?

trigger on inforamtionManagement on informationManagement__c(After insert) {
    for(informationManagement__c infoobj:trigger.new){
    
    if(infoobj.canclae_Event__c== False && infoobj.Target_People__c=='Person'){
        Resitration_from__c rsfobj=new Resitration_from__c();
        rsfobj.Record_type='new';
        rsfobj.Account_Name=infoobj.lead_Name__c;
        rsfobj.start_date__c=infoobj.start_date__c;
        isnert(rsfobj);
    
    
    
    
    }
    
    
    
    }

}
SandhyaSandhya (Salesforce Developers) 
Hi,

i would suggest you refer below trailhead module to know more about test class for trigger that can help you.

https://trailhead.salesforce.com/en/content/learn/modules/apex_testing/apex_testing_triggers
 
Best Regards,
Sandhya
aklkkaklkk
its not soluation of the problem .
Sitanshu TripathiSitanshu Tripathi
Will you please update your code, so that I can understand your code and give you a solution because your code have many misspellings ?
And tell us all the object hierarchy (Parent, Child) and fields.

https://www.sfdc4students.com/2018/02/apex-trigger-with-helper-class-and-test.html