You need to sign in to do that
Don't have an account?
Beto Carvalho 11
How do I remove comma at the end of a string when using <apex:repeat> in Visualforce email template? (parsing)
I have a Visualforce email template based on Opportunity. In it I want to incorporate all the Opportunity Team Members whose Member Role = XYZ, say, "Sales Engineer". The following code works splendidly...
Where I want:
(i.e. with no ", " at the end). There's probably more than one way to do this, but I've reached the end of my coding knowledge at this point. Ideas?
<b>Sales Engineers:</b> <apex:repeat value="{!relatedTo.OpportunityTeamMembers}" var="oppTeam"> <apex:outputText rendered="{!oppTeam.TeamMemberRole ='Sales Engineer'}"> {!oppTeam.Name}, </apex:outputText> </apex:repeat>Except that it (obviously) appends comma + space to each repeat, leaving a trailing ", " at the end:
Sales Engineers: Maggie Simpson, Krusty the Clown,
Where I want:
Sales Engineers: Maggie Simpson, Krusty the Clown
There is an idea raised to incorporate a separator in visualforce: https://success.salesforce.com/ideaView?id=08730000000YIuvAAG
If it helps please like and mark as correct, it may help others.