You need to sign in to do that
Don't have an account?

For loop not looping through every single record on the list
I have a for loop running through a list which add items from one list to another list. The source list has 8 records, and the new list will get only 7 records.
Please help
THanks
for(sumchans__Address_Master__c city: addressList) { sumchans__City_Master__c theCity = new sumchans__City_Master__c(); theCity.Name = city.sumchans__City_Name__c; theCity.sumchans__City_Name_Ext_Id__c = city.sumchans__City_Name__c;related data. theCity.sumchans__Province_Code__c = city.sumchans__Province_Code__c; cityList.add(theCity); }
Please help
THanks
As per the code snippet you have provided, both lists should get same number of records. I dont see any issue in above code snippet.
Can you please share entire code.
Thanks,
Suraj