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
karthik Jonnalagaddakarthik Jonnalagadda 

Disable and Enable Custom button

Hello All,

I have one custom button in custom object view details page. I want enable or disable button based on condition whether current record exits on another custom object. Is is possible ? if so please suggest some steps to do
Mudasir WaniMudasir Wani
Hi Karthik,

It is not possible.

Have a look on record type may be that will give you an idea.
Because using Record type you can have different page Layouts.

Record Types Overview

Creating Record Types (

How is record type access specified? (

Administrator tip sheet: Tips & Hints for Record Types

Don't forget to select best answer to make our efforts visible in the developer forum.
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
Bertrand PolusBertrand Polus
Hi, if your View Detail Page is a Visualforce Page, nothing forbids you to Enable / Disable your buttons depending on any condition.

In your page:
<apex:commandButton action="{!youmethod}" value="ButtonName" disabled="{!isBtnDisabled}"/>

On your controller class, create a property isBtnApplyVisible which has to be filled in the constructor method of the controller.

Hoping this solution will help you...