You need to sign in to do that
Don't have an account?
SalesForce Dummy
Visualforce syntax error. Help!!
'm trying to hide a command buttong if a user is not a System Administrator but I'm getting a syntax error. The command button worked until I put in the rendered atrribute. Can anyone find the syntax error?
<
apex:commandButton
value="View Expanded"
action="{!toggleForecastExpanded}"
rendered="{!IF({!$User.ProfileId}== '00eU0000000qqCOIAY', false, true)}"
/>
Thanks for your help.
Try This:
<apex:commandButton value="View Expanded" action="{!toggleForecastExpanded}" rendered="{!IF($User.ProfileId== '00eU0000000qqCOIAY', false, true)}"/>
You need not embed the $User.ProfileId in {! } again in the IF loop.
Hard coding Id is not a best idea.
{$Profile.Name} will return the current users profile.
I guess he is trying to get the profile of the logged in user. to do so that name or id must come from the apex as $User.Profile.Name is not supported.