ads

Wednesday, 29 August 2018

To set created date for a test record in test class in Salesforce

    Code Format:


     Student__c stud = new Student__c(Student_Name__c = 'Testing');
     insert stud;  

     Test.setCreatedDate(stud.Id, DateTime.newInstance(1000,20,20));  

No comments:

Post a Comment