You need to sign in to do that
Don't have an account?
Nicholas Milevsky
Rendering output text in visualforce email template with multiple conditions
Hi,
I'm a beginner with Visualforce, so please excuse my stupidity.
I'm pulling my hair out trying to get output text to render when there is more than one condition. If it's just one, there's no problem. However, the second I want to use OR or AND (and I've tried it 50 different ways), it will not work for me. I'm just trying to render something in the email if the opportunity stage is either "Verbal" or "Closed Won". I'm not using any custom controller as it didn't seem necessary. This is what the code currently looks like:
<apex:outputPanel rendered="{!(relatedTo.StageName =='Verbal' || relatedTo.StageName =='Closed Won')}">
Block of verbage.
</ apex:outputPanel>
I have tried it with OR() as well. I've tried having the "!" on both relatedTo segments, and many others. I've looked all over for the answer, and none of the fixes seem to work for me.
Thank you!
I'm a beginner with Visualforce, so please excuse my stupidity.
I'm pulling my hair out trying to get output text to render when there is more than one condition. If it's just one, there's no problem. However, the second I want to use OR or AND (and I've tried it 50 different ways), it will not work for me. I'm just trying to render something in the email if the opportunity stage is either "Verbal" or "Closed Won". I'm not using any custom controller as it didn't seem necessary. This is what the code currently looks like:
<apex:outputPanel rendered="{!(relatedTo.StageName =='Verbal' || relatedTo.StageName =='Closed Won')}">
Block of verbage.
</ apex:outputPanel>
I have tried it with OR() as well. I've tried having the "!" on both relatedTo segments, and many others. I've looked all over for the answer, and none of the fixes seem to work for me.
Thank you!
This simple code works for me in a Visualforce template. Please, do verify that you don't have any spaces in the tag names as it was giving me an error with the </ apex:outputPanel> tag due to space after /. Once the template is saved try doing the send test and verify merge fields.
All Answers
This simple code works for me in a Visualforce template. Please, do verify that you don't have any spaces in the tag names as it was giving me an error with the </ apex:outputPanel> tag due to space after /. Once the template is saved try doing the send test and verify merge fields.
Oh and the space was only a mistake I typed in here and was not in my code. Again thanks!