[SalesForce] Hide/Show detail page button based on condition

I have created a detail page button "Edit" in Account object. I want to show the button on account record if the account is "X". and to hide for other accounts. is it possible to hide the button on condition?

Best Answer

You can't hide button but you can add validation on button and perform validation based on your requirement for Onclick Javascript Custom button.

Ex:

{
  !REQUIRESCRIPT("/soap/ajax/32.0/connection.js")
}


if (addYourConditionHere) {
  alert('Validation message on button')
}
Related Topic