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
Satyananda YeluriSatyananda Yeluri 

How to load test data into login history object for testing a class

Hi, 

  My requirement is - check partner user's lastlogin date and see if it is exceeded 180 days from today. So, i have schedulable apex class and checking records from user object by above condition and it is working fine. 
Now, how do we cook test data for above query ( lastlogindate is readonly field on user object and even, i cannot use login history to populate some test data due to same issue (read-ony) object. 

So, i am running with actual data however, it may be an issue going forward. Can anybody have suggestion on this. 

Best,
Satya