Skip to main content
1 件の回答
  1. 2021年11月15日 15:41

    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;

    }

    }

0/9000