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
Anjali Joshi 22Anjali Joshi 22 

unable to load data in test class

I am trying to create test data in test class using Test.loaddata (). i see last name missing error in logs but dont see any information as which record in file is givign this error. can anyone help here?
VinayVinay (Salesforce Developers) 
Hi Anjali,

Check below examples to load data using Test.loadData.

https://www.jitendrazaa.com/blog/salesforce/using-test-loaddata-to-import-records-with-relationship/
https://sfdctechie.wordpress.com/2019/02/11/use-test-loaddata-to-import-records-with-relationship/

Please mark as Best Answer if above information was helpful.

Thanks,
Anjali Joshi 22Anjali Joshi 22
Thanks for reply Vinay.  I am using load data method to load records in test class follwing by insertion of records. I can successfully load test data but while tryign to insert  find error message in logs saying some required field is missing.how can we identify which record in csv file is causing this error?
As my test csv file have almost 500 records i want to get which record is giving this error while trying to insert these records in SF.