You need to sign in to do that
Don't have an account?
Aron Schor 24
Visual Force Email Template adds space (possible newbie question)
Hi,
I have a Visual Force template using If/Then logic. If the field is blank, don't show it. However, it adds a space. How do I fix?
This code:
{!RelatedTo.Requester_Name__r.Name} Text <apex:repeat value="{!relatedTo.Requester_Name__r}" var="con" > {!IF(ISBLANK(con.Field1__c), NULL, (con.Field1__c) + ',')} {!IF(ISBLANK(con.Primary_Field2__c), NULL, (con.Field2) + ',')} {!IF(ISBLANK(con.Primary_Field3__c), '', (con.Field3) + ',')}</apex:repeat> Text.
Displays:
Name Text Field1, Field2, Field3, Text - This is fine (If 3 fields have a value)
Name Text Field1, Text. - This is an issue, due to spacing (If just the first field has a value)
Thanks, Aron!
I have a Visual Force template using If/Then logic. If the field is blank, don't show it. However, it adds a space. How do I fix?
This code:
{!RelatedTo.Requester_Name__r.Name} Text <apex:repeat value="{!relatedTo.Requester_Name__r}" var="con" > {!IF(ISBLANK(con.Field1__c), NULL, (con.Field1__c) + ',')} {!IF(ISBLANK(con.Primary_Field2__c), NULL, (con.Field2) + ',')} {!IF(ISBLANK(con.Primary_Field3__c), '', (con.Field3) + ',')}</apex:repeat> Text.
Displays:
Name Text Field1, Field2, Field3, Text - This is fine (If 3 fields have a value)
Name Text Field1, Text. - This is an issue, due to spacing (If just the first field has a value)
Thanks, Aron!
<apex:repeat value="{!relatedTo.Requester_Name__r}" var="con" > {!SUBSTITUTE(IF(ISBLANK(con.Field1),NULL,con.Field1+', ')+IF(ISBLANK(con.Field2),NULL,con.Field2+', ')+IF(ISBLANK(con.Field3),NULL,con.Field3+',, ')+'.',', .',NULL)}</apex:repeat>