3

I have button 'Sync Account to TRAVERSE' that syncs salesforce account to Traverse ERP. I want this button only visible for Admin Users not standard and other users. I am facing difficulty to make page layout and assign to profile. As I am using PE I am unable to do that. Is there any other way to do this in PE? Thanks!!

2

You can buy custom profiles and layouts a la carte, if you wanted. That's the only "secure" way to do it, as anything less can be circumvented by an advanced user (a.k.a "hacker", in the classic computer lingo sense, not the media-hyped cyber criminal sense).

If you're only concerned about stopping causal users, some simple JavaScript in the custom button could discourage them. Something like:

If({!$Profile.Name<>"System Administrator"}) { 
    alert("I'm afraid I can't do that, {!$User.FirstName}.");
} else {
    // do your magic
} 
2
  • Sorry!! I did not mention that the button is in managed package so I can put the code you provided but the problem is it will affect all other who will upgrade or install the package. cant it be prevented with permissions or roles? – Mehul Aug 5 '14 at 10:22
  • Neither (for now); I'd suggest you use a Visualforce page to make your callout, so the administrator can configure the security for the page. If they don't have access, the system will prevent them. – sfdcfox Aug 5 '14 at 17:01
0

We use a workaround that makes use of permission sets. Create a dummy field that only people allocated the permission set have access to. Similar to sfdcfox we then use JavaScript to make a DML call. The DML will fail unless you have the permission set. Further details at http://sfdcwizards.com/archives/218/salesforce-custom-button-visibility/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.