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

List to string nearly works but not quite...
Hi Everyone,
I have a controller that gathers a list of names and then creates a string of names and puts them in an email.
The code works but the first name is displayed twice on the list. Can anyone correct it so that it only shows the names once?
Thanks
Joe
I have a controller that gathers a list of names and then creates a string of names and puts them in an email.
The code works but the first name is displayed twice on the list. Can anyone correct it so that it only shows the names once?
//Loads of stuff before this... List<Delegate__c> dels = [SELECT id, Name, FROM Delegate__c WHERE accountid__c =: AccountID] String listofDels; for(Delegate__c del: dels){ if(listofDels == NULL) listOfDels = del.Name; listOfDels = listOfDels+ '<br/>'+del.Name; //This is displaying the same del.name twice } //sort all the email stuff out here... htmlBody = htmlBody.replace('[ListOfDelegates]', listofDels); //replace text in the email with the new string of names.
Thanks
Joe
All Answers
Ta
Joe