
답변 1개

Hi Pooja,If I understood your requirement correctly, you have a list of names & you want to use these names to create accounts. 1. you can write iterate over list, create an object instance,add it in list & insert it in end. Ex.
List<String> accontNamesLst = new List<String>{'a1','b1','c1'};
List<Account> accountsToInsert = new List<Account>();
for(String strItr : accontNamesLst ){
accountsToInsert.add(new Account(Name=strItr));
}
if(!accountsToInsert.isEmpty())
insert accountsToInsert;
Happy Coding!
Regards,Amit Shingavi