You need to sign in to do that
Don't have an account?
Tux
How to disable a button on a page layout, if some checkbox is selected?
I have a custom field defined in my Opportunity standard object. It is a checkbox. When I view the details for a particular opportunity, if the checkbox is selected, I do not wish to show the custom button on the layout. However, if it is not selected, I want to show the button and execute apex code, the source of which is a VF page.
How is that possible? Tried to edit the layout, but could not find anything there.
At the moment, this is how I am doing it. By selecting the source as Onclick Javascript, and behaviour as Javascript.
But the catch is, the button is disabled, after I click on it. I want it to be disabled, when the layout loads.
do u want the button to be in disabled state in the pageload right?
hope you are using commandbutton the use the disabled property and control the disable property based on the requirement like
onlaod..
controller:
boolean blnflag = true;
public void setblnflag(boolean value){
value = false;
}
public boolean getblnflag(){
return blnflag;
}
page:
<apex:commandbutton disabled="{!blnflag}"/>
Sorry I did not make the question clearer. I am using the detail page layout, not an Apex page.
in the standard page you can't acheive this kind of scenario because where we dont have any control on the repesctive dom objects of that form....but one soultion is there through homepage components u need to write a javascript code to make this..but that is not at all suggestable....
Alright. I guess I should alert the user that the option is already checked. Although that is counter-intuitive to a UI.
hope that is the best soultion ....
TehNerd posted up an example of how manipulate buttons via the sidebar at:
http://www.tehnrd.com/show-and-hide-buttons-on-page-layouts/