You need to sign in to do that
Don't have an account?
MLamb2005
Problem with On-Click JavaScript... help please...
Hi all,
I'm trying to add the following check to an on-click piece of JavaScript in a button (to restrict access to the button). My condition in the "IF" isn't working right, anyone see why?
if({!User.ProfileId} <> '00e00000006ojvr'){ alert("This feature is currently only available to Administrators."); } else{ ** Do stuff** }
Try:
if('{!$User.ProfileId}' != '00e00000006ojvr') { alert("This feature is currently only available to Administrators."); } else{ ** Do stuff** }
All Answers
Try:
if('{!$User.ProfileId}' != '00e00000006ojvr') { alert("This feature is currently only available to Administrators."); } else{ ** Do stuff** }
I don't know your actual requirements but if it's a Visual Force page you could also use
rendered="{!IF( $User.profileId = '00e00000006ojvr', true, false)}"
That way the button is not even displayed.