You need to sign in to do that
Don't have an account?
SF_Monkey
assign list of string to name of list of an object
I am trying to insert multiple records with assigned list of names and accountid lookup. The list of string contains the name of the record then assign each of those records with accountID. I guess that I have to use a for loop; however, I am unable to execute this. Any help would be appreciated thanks!
@AuraEnabled public static void stackup(id accountid, List<String> itemsValue){ List<Acap_Checklist__c> nList = new List<Acap_Checklist__c>(); for(Acap_Checklist__c n : nList){ n.account__c = accountid; for(String c : itemsValue){ n.Name = c; } nList.add(n); } insert nList; }
All Answers