You need to sign in to do that
Don't have an account?
Sam Ward
If statement in a visualforce page to choose a different flow
Hi,
I have the below code but I just keep getting a syntax error, I want to display 1 flow if the users country is united kingdom and if not it defaults to a different flow, Here is my code below:
<apex:page standardController="Vacation_Request__c">
<apex:sectionheader title="Holiday Request - {!$User.FirstName} {!$User.LastName}"></apex:sectionheader>
{!IF(({!$User.Country} == 'United Kingdom'),
<flow:interview name="Vacation_Request" finishLocation="{!URLFOR('/home/home.jsp')}">
<apex:param name="var_UserId" value="{!$User.Id}"></apex:param>
<apex:param name="var_Username" value="{!$User.FirstName} {!$User.LastName}"></apex:param>
</flow:interview>,
<flow:interview name="Canada_Vaction_Request" finishLocation="{!URLFOR('/home/home.jsp')}">
<apex:param name="var_UserId" value="{!$User.Id}"></apex:param>
<apex:param name="var_Username" value="{!$User.FirstName} {!$User.LastName}"></apex:param>
</flow:interview>
)}
</apex:page>
any help would be much appericated.
Thanks
I have the below code but I just keep getting a syntax error, I want to display 1 flow if the users country is united kingdom and if not it defaults to a different flow, Here is my code below:
<apex:page standardController="Vacation_Request__c">
<apex:sectionheader title="Holiday Request - {!$User.FirstName} {!$User.LastName}"></apex:sectionheader>
{!IF(({!$User.Country} == 'United Kingdom'),
<flow:interview name="Vacation_Request" finishLocation="{!URLFOR('/home/home.jsp')}">
<apex:param name="var_UserId" value="{!$User.Id}"></apex:param>
<apex:param name="var_Username" value="{!$User.FirstName} {!$User.LastName}"></apex:param>
</flow:interview>,
<flow:interview name="Canada_Vaction_Request" finishLocation="{!URLFOR('/home/home.jsp')}">
<apex:param name="var_UserId" value="{!$User.Id}"></apex:param>
<apex:param name="var_Username" value="{!$User.FirstName} {!$User.LastName}"></apex:param>
</flow:interview>
)}
</apex:page>
any help would be much appericated.
Thanks
some typo mistake, I corrected use below sample code Thanks
Shaik
All Answers
you need to use the 'rendered' attribute, it will be rendered the flow when the condition is the match.
Check below Code, it may help for you
if it help for you please mark the best answer.
Thanks
Shaik
Thanks for the response, I've copied the code however I get the following error:
Error: Incorrect parameter type for function 'not()'. Expected Boolean, received Text
Any ideas on this?
some typo mistake, I corrected use below sample code Thanks
Shaik