0

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?

0

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')
}
0

Currently, Salesforce does not allow to show and hide the actions on a page layout based on some condition, but if you have the record types, you can create a different page layout for each record type and keep the buttons required for that record type.

This will give you the flexibility to show and hide button when you are using record type. Else, You have to go for the validation within your button or action's visualforce/Lightning component before invoking it.

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.