function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Raj R.Raj R. 

How to conditionally display a button?

HI,

We are using the standard Account page layouts. I was wondering what it would take to make a button conditionally show if a specific criteria was met. I am unable to find anything that allows a button to show up on a page layout conditionally. I know we can create custom page layouts and assign it per profile, but that is not the scenario. Ideally, based on the field values, the button should display or disappear. 

What is the recommended way to accomplish this?
Best Answer chosen by Raj R.
KevinPKevinP
you'll want to use the visualforce tag attribute rendered= and set it to a formula syntax for inspecting the data and determining if you want to display the button. Rendered needs to be true or false, but ultimately the rendered attribute determines if that element appears on the screen.

All Answers

KevinPKevinP
you'll want to use the visualforce tag attribute rendered= and set it to a formula syntax for inspecting the data and determining if you want to display the button. Rendered needs to be true or false, but ultimately the rendered attribute determines if that element appears on the screen.
This was selected as the best answer
J CesarJ Cesar
The only way to accomplish this is a Visualforce page, you'll need to override your standard page. In your VF page then do as KevinP said, add rendered attribute to display or hide the button based on your criteria.