1 件の回答
hey,
Try out this one , if it helps!
Please mark as Best Answer if it helped to close the thread:)
public with sharing class RandomContactFactory
{
public static List<Contact> generateRandomContacts( Integer noOfContacts, String lastName )
{
List<Contact> contacts = new List<Contact>();
for( Integer i = 0; i < noOfContacts; i++ )
{
Contact con = new Contact( FirstName = 'Test '+i, LastName = lastName );
contacts.add( con );
}
return contacts;
}
}