function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sushma  RamakrishnanSushma Ramakrishnan 

Help to set different list view based on IF condition for Profile in visualforce page

Hi All,

I have 3 Profiles(Profile 1,Profile 2,Profile 3) and 3 List Views(List View 1,List View 2 & List View 3):

When user with "Profile 1" loggsin and clicks on "Invoice" object then List View 1 should be displayed on Tab Click.The below is my code for doing that.Within this code now i need to apply "IF Condition for Profile and List View Id".Please help me do this.
<apex:page showHeader="true" tabStyle="Invoice__c" action="/a3R?fcf=00B23000000O2Ou" ></apex:page>

Thanks for Any & All Help...!
Best Answer chosen by Sushma Ramakrishnan
Sushma  RamakrishnanSushma Ramakrishnan
Hi Rohit SharmaG,

Had to tweek your code as below :
<apex:page showHeader="true" tabStyle="Test__c" action="{!if($Profile.Name ='Test,'/a3R?fcf=00B23000000OHVg',(if($Profile.Name ='Test','/a3R?fcf=00B23000000OH0n',(if($Profile.Name ='Test','/a3R?fcf=00B23000000OH0s',false)))))}">

</apex:page>

 

All Answers

Rohit SharmaGRohit SharmaG
Hi, Try this -
<apex:page showHeader="true" tabStyle="Invoice__c" action="if($Profile.Name ='Profile 1',/a3R?fcf=ListView1Id,(if($Profile.Name ='Profile 2',/a3R?fcf=ListView2Id,(if($Profile.Name ='ListView3Id',/a3R?fcf=00B23000000O2Ou,false)))">

</apex:page>
Sushma  RamakrishnanSushma Ramakrishnan
Hi Rohit SharmaG,

Had to tweek your code as below :
<apex:page showHeader="true" tabStyle="Test__c" action="{!if($Profile.Name ='Test,'/a3R?fcf=00B23000000OHVg',(if($Profile.Name ='Test','/a3R?fcf=00B23000000OH0n',(if($Profile.Name ='Test','/a3R?fcf=00B23000000OH0s',false)))))}">

</apex:page>

 
This was selected as the best answer